Topic: HOWTO: save an entity with a composition relationship

Hey guys,

I have two entities, product and additionalData, and I want to create a additionalData in the product's form, because they are created at the same time.

A product can have many additionalData, that will be created when I create a product.

How to I do it?

tks.

Re: HOWTO: save an entity with a composition relationship

There is a multipart railscast covering this - Part 1 is here http://railscasts.com/episodes/196-nest … orm-part-1 It's covers how to nest attributes for a set of fields in a view belonging to a model related to the form_for model inside your params hash and how to arrange the parent model to handle those nested params automatically

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)