=> ActiveRecord::HasManyThroughCantAssociateNewRecords: Cannot
associate
new records through 'Catalogue#catalogue_items' on '#'. Both records
must have an id in order to create the has_many :through record
associating them.
from
It's exactly was it says. You need to save catalogue first.
=> ActiveRecord::HasManyThroughCantAssociateNewRecords: Cannot
associate
new records through 'Catalogue#catalogue_items' on '#'. Both records
must have an id in order to create the has_many :through record
associating them.
from
It's exactly was it says. You need to save catalogue first.
catalogue2 = Catalogue.find_by_id(2)
p catalogue2.products
=>
shit.... And I don´t know realy why
what should I do?!? take catalogue and create a knew empty catalogue2,
save this and copy all attributes of catalogue into catalogue2 and save
after that catalogue2 again?!?
uff.... that´s heavy
This doesn't work. you can only specify attributes in the options to
new/create.
what should I do?!? take catalogue and create a knew empty catalogue2,
save this and copy all attributes of catalogue into catalogue2 and save
after that catalogue2 again?!?
Edge rails (soon to be 2.1) doesn't have this restriction, you could
always do that. If not you sill just have to save catalogue2 first
before adding to catalogue2.products