ActiveModel::MassAssignmentSecurity::Error can't see where to make variable accessible

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.

Answers


Add :feature_ids to the Outboard Models attr_accessible.


Need Your Help

JPA OneToMany list is always empty

java hibernate inheritance jpa one-to-many

I'm working on a JPA project, and i had an issue with OneToMany relationship.

R: Subsetting with two variables

r subset

This is a follow-up to: R: Subsetting on increasing value to max excluding the decreasing