Usually a form maps to a AR instance (and hence a database row).
Consider the simple example of a Person model in which there is just one attribute “name”. [This is just an example to illustrate the problem]
Now I need a single form that allows multiple people to be added, basically multiple text fields (for “name” attribute) each resulting in a new ActiveRecord object for each person, but a single action and single submit button.
Another example would be multiple image upload from a single form [Flickr]
The way I am thinking of doing this is by having a model “People” that encapsulates many Person objects, on submit the controller method of Person shall iterate over its params and create as many Person objects as required. The People class though a model does not have a database table of its own.
My question : Is there a better way/pattern of doing this?