Nik B
2008-Jun-08 17:29 UTC
Plugins - helper function is an "undefined method", Objects "can''t be referred"
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 Thanks, Nik --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jun-08 17:35 UTC
Re: Plugins - helper function is an "undefined method", Objects "can''t be referred"
On 8 Jun 2008, at 18:29, Nik B wrote:> > 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? >Does the problem go away if you turn on class caching in development.rb ? (and then restart the server) Fred> here is the trace : http://pastie.org/211114 > > Thanks, > Nik > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nik B
2008-Jun-08 17:48 UTC
Re: Plugins - helper function is an "undefined method", Objects "can''t be referred"
> 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? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jun-08 21:36 UTC
Re: Plugins - helper function is an "undefined method", Objects "can''t be referred"
On Jun 8, 6:48 pm, Nik B <nikbau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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: http://www.spacevatican.org/2008/5/28/reload-me-reload-me-not Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Maybe Matching Threads
- remote_function in IE with select input onchange
- Parameters for FormOptionsHelper select vs. FormTagHelper select_tag
- Undefined method "xxx" of a model when calling a helper
- Working around/with Restful Authentication
- Observing few fields in a form - Best Practise?