On Dec 16, 1:50 am, David Sousa <rails-mailing-l...@andreas-s.net>
wrote:
> Hi Hassan Schroeder,
> thanks for replay it.
>
> So, to solve the problem I had to create a unique ID to each element.
> That was easy I used this code:
>
> <% fields_for "invoice[items_attributes][#{Time.now.tv_usec.to_s}]",
> invoice_item  do |form_invoice_item| -%>
>
If the forms you had right at the beginning only submitted incorectly
because of the duplicate ids then I'd try going back to that original
code and only changing
<%= form_invoice_item.text_field :item %>
to
<%= form_invoice_item.text_field :item, :id =>
"invoice_items_attributes_item_#{invoice_item.id}" %>

Fred
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to