My erb template looks like this: <% for f in @finders do %> ... <tr> <%debugger%> <%= emitActionLinks(f, edit_finder_path(f), f.owner != 0) %> </tr> <% end %> emitActionLinks is defined in application_helper.rb and returns a string of HTML. At the debugger loction, I can inspect the parameters of emitActionLinks, but if it gets executed, this error message pops up: undefined local variable or method `f'' for #<ActionView::Base:0x7f6d514eca80> Why? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 August 2010 10:42, Fritz Trapper <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> My erb template looks like this: > > <% for f in @finders do %> > ... > <tr> > <%debugger%> > <%= emitActionLinks(f, edit_finder_path(f), f.owner != 0) %> > </tr> > <% end %> > > emitActionLinks is defined in application_helper.rb and returns a string > of HTML. > > At the debugger loction, I can inspect the parameters of > emitActionLinks, but if it gets executed, this error message pops up: > > undefined local variable or method `f'' for > #<ActionView::Base:0x7f6d514eca80>Can you post the whole error trace please? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I got it: Its a misleading error location message: Showing app/views/finders/index.html.erb where line #27 raised: undefined local variable or method `f'' for #<ActionView::Base:0x7f6d514eca80> Extracted source (around line #27): 25: 26: <%debugger%> 27: <%= emitActionLinks(f, edit_finder_path(f), f.owner != 0) %> 28: </tr> 29: <% end %> 30: </table> The reason was inside emitActionLinks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.