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?
on 2008-06-17 19:24
on 2008-06-19 11:47