Domanda

What would I need to do to update the make_voteable gem for rails 4?

In Rails 4, attr_accessible has been removed (with strong_parameters) in it's place. I cannot find what/where to place to code to stop trhe line below throughing a mass assignment error

 C:>rails s
 C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0.rc1/lib/active_model/deprecated_mass_assignment_security.rb:14:in `attr_accessible': `attr_accessible` is extracted out of Rails into
 a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one. (RuntimeError)

I know that I have to permit mass assignment, but am not sure where to do it given these are Modules not Controllers.

https://github.com/medihack/make_voteable

È stato utile?

Soluzione

Hope your old gem will be updated soon, but meanwhile you can try to bring back protected_attributes in your Rails 4 app with using this gem:

gem 'protected_attributes'

https://github.com/rails/protected_attributes

Maybe with this you can launch your app with available 'make_voteable' gem.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top