Never mind. Got it working. I should pay more attention to the
documentation. Sorry to waste your time.

On Jul 20, 8:10 pm, pepe <[email protected]> wrote:
> I have an edit page that generates a few input fields I organized in a
> table, like so:
>       <tr>
>         <td>Driver License</td>
>         <td>
>           <input
> id="person_accounts_attributes_0_account_documents_attributes_1_number"
> name="person[accounts_attributes][0][account_documents_attributes][1]
> [number]"  type="text" />
>         </td>
>       </tr>
>
>       <tr>
>         <td>Passport</td>
>         <td>
>           <input
> id="person_accounts_attributes_0_account_documents_attributes_47_number"
> name="person[accounts_attributes][0][account_documents_attributes][47]
> [number]" type="text" value="1" />
>         </td>
>       </tr>
>
>       <tr>
>         <td>SSN</td>
>         <td>
>           <input
> id="person_accounts_attributes_0_account_documents_attributes_48_number"
> name="person[accounts_attributes][0][account_documents_attributes][48]
> [number]" type="text" value="2" />
>         </td>
>       </tr>
>
> The same fields work great in a 'new' page (probably because that page
> accepts values only once) but if I click on the Submit button of the
> 'edit' page the fields that have a value generate duplicate records in
> the DB. The fields that contain no value do not.
>
> The 'update' action just issues a
> @person.update_attributes(params[:person]) statement.
>
> I have been battling this for a long time.
>
> Any idea why this might be happening?
>
> Thank you.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to