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
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]
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs