# Form element names with multiple new rows

**URL:** <https://www.ruby-forum.com/t/form-element-names-with-multiple-new-rows/141808>\
**Category:** Rails\
**Created:** [June 30, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/form-element-names-with-multiple-new-rows/141808 "2008-06-30T19:02:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [June 30, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/form-element-names-with-multiple-new-rows/141808/1 "2008-06-30T19:02:20Z")

</div>

I have a report with many rows some of which refer to an existing  
ActiveRecord model object and some new ones. I’m trying to figure out  
a naming convention for the form elements so that Rails will properly  
convert it into a params hash in my controller.

My first idea is to do something like the below but Rails will confuse  
the data for the two ‘new’ rows  
Enter a new invitation   
  
Enter a new invitation   
  
Update an existing invitation

My second idea is to do something like the below and parse out the  
‘new\_’ params in my controller  
Enter a new invitation   
  
  
Enter a new invitation   
  
  
Update an existing invitation

Is this a common problem that others have solved in a standard way  
before? Any pointers to plugins or techniques others have used?

Thanks  
Alex
