# Forms with multiple item entry

**URL:** <https://www.ruby-forum.com/t/forms-with-multiple-item-entry/63873>\
**Category:** Rails\
**Created:** [January 22, 2006, 3:22am UTC](https://www.ruby-forum.com/t/forms-with-multiple-item-entry/63873 "2006-01-22T03:22:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janovetz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@janovetz](https://www.ruby-forum.com/u/janovetz)\
**Post date:** [January 22, 2006, 3:22am UTC](https://www.ruby-forum.com/t/forms-with-multiple-item-entry/63873/1 "2006-01-22T03:22:01Z")

</div>

Hello-

I was wondering what would be the simplest/cleanest way to have a view  
offer entry fields for several items (e.g. the “quantity” for items in a  
shopping cart).

If I have a model such as “cart” which has\_many “items”, then I can use  
“cart.items” to get an array of all of them. Each item has a quantity,  
so I’d have “cart.items[n].quantity” that I would like to display and  
allow the user to enter.

What’s the best way to present this (not so hard) and get it back into  
the controller and save them. Does each one have to be save()'ed  
independently or is there a convenient ‘array-save’ of some sort?

Jake
