加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 带有Rails 4的ActiveRecord Reputation System

发布时间:2020-12-17 01:31:57 所属栏目:百科 来源:网络整理
导读:我试图使用Rails 4应用程序 Twitter’s ActiveRecord Reputation System gem 我已经在我的Gemfile中添加了gem’activerecord-reputation-system’并运行了bundle install 当我运行rails generate reputation_system时,我收到以下错误: /Users/Dee/.rvm/gems
我试图使用Rails 4应用程序 Twitter’s ActiveRecord Reputation System gem

我已经在我的Gemfile中添加了gem’activerecord-reputation-system’并运行了bundle install

当我运行rails generate reputation_system时,我收到以下错误:

/Users/Dee/.rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.2/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)

我曾尝试将gem’en protected_attributes’添加到我的Gemfile中,但是没有修复它.

有任何想法吗?

解决方法

运用

gem 'activerecord-reputation-system',github: 'NARKOZ/activerecord-reputation-system',branch: 'rails4'

在我的Gemfile中解决了这个问题

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读