Thanks for your help! I got this code: 1. s = Sale.new 2. p = Product.new 3. p.save pop = s.pops.build(:qty => 10, :disc = 0) #associates pop with sale and puts it in the collection 4. pop.product = p 5. s.save #saves sale and pop
-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

