# How to create multiple rows in a model in a form

**URL:** <https://www.ruby-forum.com/t/how-to-create-multiple-rows-in-a-model-in-a-form/136670>\
**Category:** Rails\
**Created:** [May 5, 2008, 11:13am UTC](https://www.ruby-forum.com/t/how-to-create-multiple-rows-in-a-model-in-a-form/136670 "2008-05-05T11:13:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fries88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@fries88](https://www.ruby-forum.com/u/fries88)\
**Post date:** [May 5, 2008, 11:13am UTC](https://www.ruby-forum.com/t/how-to-create-multiple-rows-in-a-model-in-a-form/136670/1 "2008-05-05T11:13:45Z")

</div>

Hi.

How do I create multiple rows in one model in a form? I have done the  
tutorial, multiple models in one form by ryan. This might be easy for  
most programmers. But I just don’t understand how to multiple rows in  
one model in a form.

Can someone please help me?

Thanks

---

<div class="post-metadata">

**Author:** ![fries88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6bbea6/32.png) [@fries88](https://www.ruby-forum.com/u/fries88)\
**Post date:** [May 5, 2008, 2:09pm UTC](https://www.ruby-forum.com/t/how-to-create-multiple-rows-in-a-model-in-a-form/136670/2 "2008-05-05T14:09:00Z")

</div>

You need to use the :index option when creating your fields (eg. with  
text\_field).

Stephen Chu has written a great post on this:

> **[params\[:fu\] #3 ) Using fields\_for and the index option to create a new parent...](http://www.stephenchu.com/2008/03/paramsfu-3-using-fieldsfor-and-index.html)**
>
> Alright, the last couple days were easy. Today, let's take a look at a slightly more complicated example, but one that occurs on almost ever...

Hope that helps

- Barney

On May 5, 7:13 pm, user splash [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
