Based on this from AWDWR 2nd ed.:
“If you need to edit multiple objects from the same model on one form,
open and closed brackets to the name of the instance variable you pass
the form helpers. This tells Rails to include the objectâ€™s id as part of
name. For example, the following template lets a user alter one or more
URLs associated with a list of products.”
Wouldn’t it be nice if you could do this kind of thing to non-saved
model objects (which don’t have ids yet) as well? Maybe the open/closed
brackets could indicate to include the index of the object in the
collection if the object were a new_record? and then you could more
easily update attributes on the objects in that collection.
As it stands, I have to set up and maintain a “name unique-ing” scheme
for my form fields and know about that scheme in a controller when I go
to save the object.