Radio buttons show false when clicked

Hi i have this code :
<%= f.input :xyz, :label => “Select a number:”,:collection =>
[“twenty.”,“forty”],
:as => :radio%>

where xyz is a boolean field, so when i submit my form and check in the
database it shows the selection as false even though i’ve selected a
radio
button and there’s also a validates presence of

On Mar 7, 2013 5:58 PM, “NN Dodhia” [email protected] wrote:

Hi i have this code :
<%= f.input :xyz, :label => “Select a number:”,:collection =>
[“twenty.”,“forty”],
:as => :radio%>

where xyz is a boolean field, so when i submit my form and check in the
database it shows the selection as false even though i’ve selected a
radio
button and there’s also a validates presence of

What do you get in the params?


You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected]
To post to this group, send email to [email protected]
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/A10dXRRascwJ.

On 7 March 2013 12:27, NN Dodhia [email protected] wrote:

Hi i have this code :
<%= f.input :xyz, :label => “Select a number:”,:collection =>
[“twenty.”,“forty”],
:as => :radio%>

Can you point to the docs for the use of :as => :radio in that way, I
can’t seem to find it.

where xyz is a boolean field, so when i submit my form and check in the
database it shows the selection as false even though i’ve selected a radio
button and there’s also a validates presence of

Note that false is a value, so validates presence of will be quite
happy with false. It is not the same as nil.

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs