# Editing multiple rows of data in one form

**URL:** <https://www.ruby-forum.com/t/editing-multiple-rows-of-data-in-one-form/126922>\
**Category:** Rails\
**Created:** [January 23, 2008, 2:08pm UTC](https://www.ruby-forum.com/t/editing-multiple-rows-of-data-in-one-form/126922 "2008-01-23T14:08:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![costi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@costi](https://www.ruby-forum.com/u/costi)\
**Post date:** [January 23, 2008, 2:08pm UTC](https://www.ruby-forum.com/t/editing-multiple-rows-of-data-in-one-form/126922/1 "2008-01-23T14:08:52Z")

</div>

I am able to edit multiple rows of data in one form using ‘object[]’  
like here:  
[http://jgchristopher.blogspot.com/2005/09/ruby-on-rails-editing-multiple-rows-of.html](http://jgchristopher.blogspot.com/2005/09/ruby-on-rails-editing-multiple-rows-of.html)

The problem appears when I want to edit old values and I want to add new  
values, all in the same form.

This is the field when the object exists:

This is the blank field waiting to be filled out.

These two approaches work good, separately. In the same form they don’t  
work.

When I give the “mixed bowl” Rails dies with a server error 500 and  
gives this message:  
Conflicting types for parameter containers. Expected an instance of  
Hash, but found an instance of Array. This can be caused by passing  
Array and Hash based paramters qs[]=value&qs[key]=value.

It makes sense… some extra\_charges\_customer have indexes, some not.  
The solution? Should I number the new values with a magic value (say  
-1)? Should I have a new array for the new values, say  
extra\_charges\_customer\_new[] ? What should be the most elegant approach  
in this case?
