You know the helper for check boxes generates a hidden field with an
"unchecked" value.

In a form with fields like this:

  <% fields_for "project[invoice_attributes][]", invoice, :index =>
nil do |form| %>
    <%= form.check_box :paid %>
    ...

the parameters parser gets confused by the pair and puts the checked
value in a hash by itself, see this XML dump:

   http://pastie.org/216415

thus, there's a spurious hash on the one hand, and the actual model
hash gets the unchecked value unconditionally.

Looking at UrlEncodedPairParser#bind in request.rb, my understanding
is that we switch to a new hash when we get a key that exists in the
previous hash (top[-1]). Since at that point there's no knowledge
about what's a check box or boolean model attribute I don't quite see
how that could be addressed.

Ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to