我需要做什么来更新Rails4的make_voteable gem?
在Rails 4中,attr_accessible已经被移除(与strong_parameters一起)。我找不到通过批量赋值错误停止以下行的代码的位置/位置
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)我知道我必须允许批量赋值,但不确定在哪里可以这样做,因为这些是模块而不是控制器。
发布于 2013-05-24 06:47:53
希望你的旧gem能尽快更新,但同时你可以尝试使用这个gem在你的Rails 4应用程序中恢复protected_attributes:
gem 'protected_attributes'
https://github.com/rails/protected_attributes
也许你可以用'make_voteable‘gem启动你的应用程序。
https://stackoverflow.com/questions/16724128
复制相似问题