# Strange error message in erb template

**URL:** <https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600>\
**Category:** Rails\
**Created:** [August 20, 2010, 11:42am UTC](https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600 "2010-08-20T11:42:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trapper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/2acd7d/32.png) [@trapper](https://www.ruby-forum.com/u/trapper)\
**Post date:** [August 20, 2010, 11:42am UTC](https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600/1 "2010-08-20T11:42:03Z")

</div>

My erb template looks like this:

\<% for f in @finders do %\>  
…

 \<%debugger%\> \<%= emitActionLinks(f, edit\_finder\_path(f), f.owner != 0) %\> \<% 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?

---

<div class="post-metadata">

**Author:** ![trapper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/2acd7d/32.png) [@trapper](https://www.ruby-forum.com/u/trapper)\
**Post date:** [August 20, 2010, 11:52am UTC](https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600/2 "2010-08-20T11:52:22Z")

</div>

On 20 August 2010 10:42, Fritz T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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

---

<div class="post-metadata">

**Author:** ![trapper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/2acd7d/32.png) [@trapper](https://www.ruby-forum.com/u/trapper)\
**Post date:** [August 20, 2010, 12:02pm UTC](https://www.ruby-forum.com/t/strange-error-message-in-erb-template/193600/3 "2010-08-20T12:02:47Z")

</div>

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:   
29: \<% end %\>  
30:

The reason was inside emitActionLinks
