# Plugins - helper function is an "undefined method", Objects "can't be referred"

**URL:** <https://www.ruby-forum.com/t/plugins-helper-function-is-an-undefined-method-objects-cant-be-referred/139891>\
**Category:** Rails\
**Created:** [June 8, 2008, 7:29pm UTC](https://www.ruby-forum.com/t/plugins-helper-function-is-an-undefined-method-objects-cant-be-referred/139891 "2008-06-08T19:29:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [June 8, 2008, 7:29pm UTC](https://www.ruby-forum.com/t/plugins-helper-function-is-an-undefined-method-objects-cant-be-referred/139891/1 "2008-06-08T19:29:35Z")

</div>

I’m modifying a shopping cart plugin, MinimalCart, and for some reason  
I can add one item to the cart multiple times, but as soon as I add a  
second item, all kinds of strange things start happening.

An actionview::template error is thrown because a method defined in  
application\_helper is “undefined”

What could cause a defined application helper method to all the sudden  
not be defined?

here is the trace : [http://pastie.org/211114](http://pastie.org/211114)

Thanks,  
Nik

---

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [June 8, 2008, 7:36pm UTC](https://www.ruby-forum.com/t/plugins-helper-function-is-an-undefined-method-objects-cant-be-referred/139891/2 "2008-06-08T19:36:04Z")

</div>

On 8 Jun 2008, at 18:29, Nik B wrote:

> 

Does the problem go away if you turn on class caching in  
development.rb ? (and then restart the server)

Fred

---

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [June 8, 2008, 7:49pm UTC](https://www.ruby-forum.com/t/plugins-helper-function-is-an-undefined-method-objects-cant-be-referred/139891/3 "2008-06-08T19:49:02Z")

</div>

> Does the problem go away if you turn on class caching in  
> development.rb ? (and then restart the server)

Yes it does! Mind explaining a little bit about how that might be  
causing this issue?

---

<div class="post-metadata">

**Author:** ![Nik\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ee59a6/32.png) [@Nik\_B](https://www.ruby-forum.com/u/Nik_B)\
**Post date:** [June 8, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/plugins-helper-function-is-an-undefined-method-objects-cant-be-referred/139891/4 "2008-06-08T23:37:00Z")

</div>

On Jun 8, 6:48 pm, Nik B [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Does the problem go away if you turn on class caching in  
> > development.rb ? (and then restart the server)
> 
> Yes it does! Mind explaining a little bit about how that might be  
> causing this issue?

Short version: when that setting is false your app is reloaded between  
requests, but plugins aren’t. If a plugin is holding onto a class,  
reference etc… from before the app gets reloaded then post-reload  
it’s holding onto (essentially) junk. One way around is to make the  
plugin be reloaded at the same time as the app  
Long version:

> **[Reload me, Reload me not - Space Vatican](https://www.spacevatican.org/2008/5/28/reload-me-reload-me-not/)**
>
> Rails’ development\[1\] mode automatic reloading is pretty nifty. It would really suck having to restart the server everytime you made a change, …

Fred
