I am able to edit multiple rows of data in one form using 'object'
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:
name="extra_charges_customer[amount]" size="5" value="234.00"
This is the blank field waiting to be filled out.
name="extra_charges_customer[amount]" size="5" type="text">
These two approaches work good, separately. In the same form they don't
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?