The answer can be found here: http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible
However, I will elucidate.
By setting attr_accessible :pic_attributes
, you are setting a white list for what attributes can be set via mass assignment. In other words, you are saying that ONLY the attributes you've listed can be set by doing things like cloth = Cloth.new(params[:cloth])
. Any other attribute you are saying should be set by using their accessors, such as cloth.title = params[:title]
.
If you need the attr_accessible
, then add the other attributes to your list.
attr_accessible :pic_attributes, :title, :description, etc ...