Reputation: 8998
I am getting the following error when I create a new object from my form: Can't mass-assign protected attributes: feature_ids
. In my models I have the following:
class Outboard < ActiveRecord::Base
attr_accessible :make, :model, :price, :features
has_many :features, :through => :Outboardfeature
has_many :Outboardfeature
end
class Feature < ActiveRecord::Base
attr_accessible :name
has_many :outboards, :through => :Outboardfeature
has_many :Outboardfeature
end
class Outboardfeature < ActiveRecord::Base
attr_accessible :feature_id, :outboard_id
belongs_to :feature, :class_name => "Feature", :foreign_key => "feature_id"
belongs_to :outboard, :class_name => "Outboard", :foreign_key => "outboard_id"
end
I can't see where to make the feature_ids accessible from the error as in my Outboard model I have made features accessible.
Upvotes: 0
Views: 329