Hi all,
I'm having trouble getting my InventoryItem to accept nested attributes which is strange.
In my script/console, I did the following:
>> InventoryItem.create!(:name => 'what', :image_attributes => [ {:image => File.open("/home/davidc/Desktop/letterbx.jpg", "r") }])
ActiveRecord::UnknownAttributeError: unknown attribute: image_attributes
I am not sure why I'm getting the unknown attribute error when in my model, I already did accept_nested_attributes.
I'm using Rails v2.3.5.
Inventory Item Model
class InventoryItem < ActiveRecord::Base
uuid_it
belongs_to :user
has_many :orders
has_many :images, :validate => true
accepts_nested_attributes_for :images
end
Image
class Image < ActiveRecord::Base
belongs_to :inventory_item
has_attached_file :image, :style => { :medium => "300x300>", :thumb => "100x100>" }
end