Tag: 大规模分配

请使用新建议的params保护模型(strong_parameters)或将`protected_attributes`添加到gemfile中

当我在我的Relationship模型中添加attr_accessible时就发生了这种情况。 class Relationship < ActiveRecord::Base attr_accessible :followed_id end 不使用Devise或protected_attributes gem,这有什么办法? 我知道在控制器中你调用一个需要和允许字段的私有方法。 这也是你应该在模型中做的事吗? 这里的约定是什么? 谢谢!