2008/11/14 Hongli Lai <[EMAIL PROTECTED]>

>
> Before this commit, the hidden_field helper would output:
>  <input type="hidden" name="person[is_alien]" />
> As you can see, there's no "value" attribute. Upon submitting the
> form, @person.is_alien would be set to nil instead of the expected
> false, causing an SQL error. This is solved by making hidden_field
> output value="false":
>  <input type="hidden" name="person[is_alien]" value="false" />


Thanks Koz for a brief and Hongli for more detailed explanation, but I don't
think you got my question right.

You guys are talking about (hidden) textual form controls that map to
booleans. That's fine. I'm talking about HTML attribute serialization in
general, meaning *everything besides* textual form controls mapping to
booleans, and why I think this commit should be reverted. This is the
reason:

  <% tag :input, :type => "checkbox", :checked => false %>

Who here thought that this creates a text input that isn't checked? Well,
you thought wrong. This generates an initially checked box.

--~--~---------~--~----~------------~-------~--~----~
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