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)
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:
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.