Nested Model Form


#1

I noticed when I have a form up that reflects a parent and two types
of children that the names of the field use a global index of the
total number of available children. I expected it to be scoped per
child type.

For example, if I have post that has_many comments_type1 and many
comments_type2, the form would look something like this

Shouldn’t the second input’s name be post[comments_type2_attributes]
[0] ?

The code that does this is in actionpack-2.3.2/lib/action_view/helpers/
form_helper.rb on line 1028.

Thanks.

-Nash