Can I use the "scaffold" command to have multiple objects on my page?

I am familiar with how to use scaffold to generate a view where I can
create an object. What I would like to do is have a view where I can
create multiple of the same object, say five of them. How can I do
that?

Thanks, - Dave

[email protected] wrote:

I am familiar with how to use scaffold to generate a view where I can
create an object. What I would like to do is have a view where I can
create multiple of the same object, say five of them. How can I do
that?

Write your own view. Have one form with separate fields for each of the
five objects. So instead of model[field] you have model[1][field]
through model[5][field]. Iterate through params[:model] in your create
action to create multiple objects.

Jeremy

Much obliged for this info. On the controller end, how would I get
those objects from the params variable and save them? The object is
called line_item and the two attributes are “item_number” and
“comments”.

Thanks again, - Dave

On Jan 25, 10:59 am, Jeremy E. [email protected]