class Depot < ActiveRecord::Base
attr_accessible :code, :designation
has_many :articles
end
class Famille < ActiveRecord::Base
attr_accessible :code, :designation
has_many :articles
end
class Article < ActiveRecord::Base
belongs_to :depot
belongs_to :famille
attr_accessible :code, :designation
end
当我尝试使用 depot 和 famille 字段创建新文章时出现此错误,我该如何解决?
ActiveModel::MassAssignmentSecurity::Error in ArticlesController#create
Can't mass-assign protected attributes: depot, famille