This is a demo app to reproduce the bug for
undefined local variable or method ‘cache_tags’ for #<Product:…
-
After cloning and bundle install
-
cp config/database.yml.example config/database.yml
and change for your database credentials
-
rake db:create db:migrate
-
foreman start
Visit localhost:3000
click on add a new product
add it.
Then go back to the code and change something on the product.rb e.g. add an attr_accessor :something
save and go back to the browser. Try to edit or add a new an you’ll receive the undefined local variable or method ‘cache_tags’ for #<Product:…
After reading the issues reported before for Rocket-tag and confirm that nothing fix it I’ve tried to add this to model
# Minor hack added to make Rocket_Tag work with Tag-it plugin # If this method doesn't exists then the tag attribute must be present # on the form. def cache_tags super end
At first sight it looks like it’ll work. But after a minor changes on the model, the error came back.