On here:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-check_box-label-Gotcha
you see this code:
<%= fields_for "project[invoice_attributes][]", invoice, :index
=> nil
do |form| %>
<%= form.check_box :paid %>
...
<% end %>
why are they using :index => nil in the example? I mean I know that
what it does is ensure that the invoice objects do not get passed an
index number so that you have this: project[invoice_attributes][]
rather than this: project[invoice_attributes][1]. But why in the above
example, do they want to achieve this? It seems as though invoice is
an existing object and therefore is not a new record.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.