/cloth/createにPOSTを実行すると警告が表示されます:保護された属性を一括割り当てできません:title、description、cloth_type、pic
布.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