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
Now I need a single form that allows multiple people to be added,
multiple text fields (for “name” attribute) each resulting in a new
ActiveRecord object for each person, but a single action and single
Another example would be multiple image upload from a single form
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
shall iterate over its params and create as many Person objects as
The People class though a model does not have a database table of its
My question : Is there a better way/pattern of doing this?