2008/11/14 <[EMAIL PROTECTED]>
> f.hidden_field :some_boolean_attribute
>
> when the value is false, it gets turned into value = "", which gets turned
> into nil by attributes=. Does it break something of yours?
So it's about boolean fields and form serialization. Got it.
No, nothing broke for me, I was just wondering why output the attribute at
all. In HTML, foo="false" means that foo is true. Much more correct for
attribute specified in Ruby as { :foo => false } is to produce no output at
all, and that we put some special-casing to form helpers like `hidden_field`
to convert booleans to strings prior to sending these attributes to common
tag helpers.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---