protected Rails 4

Hello I tried To use attr_protected on Rails 4 but I couldn't. It's say attr_protected 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.

What can I do know ?

attr_protected :project_id

You really should consider using strong parameters instead. Otherwise, you'll run into a mess later with your mass assignment rules.

But, if you insist, add this to your Gemfile :

gem "protected_attributes", "~> 1.0.7"

And run Bundler:

bundle install

按照建议开始使用强参数(推荐)或移回受保护的属性。

链接地址: http://www.djcxy.com/p/35998.html

上一篇: 无法运行ActiveRecord迁移

下一篇: 受保护的Rails 4