When doing a POST to /cloth/create I get a WARNING: Can't mass-assign protected attributes: title, description, cloth_type, pic
cloth.rb
class Cloth
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes attr_accessible :pics
field :title
field :description
field :cloth_type
belongs_to :seller
has_many :pics
attr_accessible :pic_attributes
accepts_nested_attributes_for:pics
end
pic.rb
class Pic
include Mongoid::Document
include Mongoid::Paperclip
has_mongoid_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" },
:storage => :cloud_files,
:cloudfiles_credentials => "#{Rails.root}/config/rackspace.yml",
:path => ":attachment/:id/:timestamp_:style.:extension"
belongs_to :cloth
attr_accessible :cloth_attributes
def create
@cloth = Cloth.create!(params[:cloth])
end
end