Forms containing collections

Hi,

Let’s say I have two models: User and Location. A User can have several
locations.
(has_many, and belongs_to). I have the user edit form with user fields,
but also a table containing his locations. With some link_to_remote and
a rjs, we can add new locations ‘inline’. Each location field has some
input(‘location[]’, …) format.

When saving user, it doesn’t create also associated assocations, and I
do not know why. He does not even validate locations.

Hash is something like that: {“commit”=>“Save”, “action”=>“edit”,
“id”=>“5”, “location”=>{“address”=>“foo”}}

What’s the problem here?

  • model assocations definition?
  • parameters hash?

Thank you for your help,
JE