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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/A10dXRRascwJ. For more options, visit https://groups.google.com/groups/opt_out.
On Mar 7, 2013 5:58 PM, "NN Dodhia" <aca10nnd-1V21x8GFL1deXsq7+8kxVA@public.gmane.org> 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 thedatabase 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 Groups"Ruby on Rails: Talk" group.> To unsubscribe from this group and stop receiving emails from it, send anemail to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visithttps://groups.google.com/d/msg/rubyonrails-talk/-/A10dXRRascwJ.> For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 7 March 2013 12:27, NN Dodhia <aca10nnd-1V21x8GFL1deXsq7+8kxVA@public.gmane.org> 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 ofNote that false is a value, so validates presence of will be quite happy with false. It is not the same as nil. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.