Hi i have this code: <div class ="radio"> <%= radio_button_tag(:milk_code,"Full.", :checked =>(:milk_code ==''Full.'')) %> <%= label_tag(:milk_code1, "Full") %> <%= radio_button_tag(:milk_code,"Milk.",:checked =>(:milk_code == ''Skim''))%> <%= label_tag(:milk_code2, "Skim") %> <%= radio_button_tag(:milk_code,"Semi-Skim'')) %> <%= label_tag(:milk_code3, "Semi-Skim") %> But when i submit my form and check the database the value in milk_code is not saved, any ideas? Also milk_code and milk_code1,2,3 are boolean. -- 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/-/ctaTsEst1FIJ. For more options, visit https://groups.google.com/groups/opt_out.
NN Dodhia wrote in post #1101393:> Hi i have this code: > <div class ="radio"> > <%= radio_button_tag(:milk_code,"Full.", :checked =>(:milk_code > ==''Full.'')) %> > <%= label_tag(:milk_code1, "Full") %> > > <%= radio_button_tag(:milk_code,"Milk.",:checked =>(:milk_code => ''Skim''))%> > <%= label_tag(:milk_code2, "Skim") %> > > <%= radio_button_tag(:milk_code,"Semi-Skim'')) %> > <%= label_tag(:milk_code3, "Semi-Skim") %> > > But when i submit my form and check the database the value in milk_code > is > not saved, any ideas? Also milk_code and milk_code1,2,3 are boolean.try :checked => ''checked'' -- Posted via http://www.ruby-forum.com/. -- 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.
I tried that and it didnt work. any other ideas? On Wednesday, March 13, 2013 11:48:26 AM UTC, NN Dodhia wrote:> > Hi i have this code: > <div class ="radio"> > <%= radio_button_tag(:milk_code,"Full.", :checked =>(:milk_code > ==''Full.'')) %> > <%= label_tag(:milk_code1, "Full") %> > > <%= radio_button_tag(:milk_code,"Milk.",:checked =>(:milk_code == > ''Skim''))%> > <%= label_tag(:milk_code2, "Skim") %> > > <%= radio_button_tag(:milk_code,"Semi-Skim'')) %> > <%= label_tag(:milk_code3, "Semi-Skim") %> > > But when i submit my form and check the database the value in milk_code is > not saved, any ideas? Also milk_code and milk_code1,2,3 are boolean. >-- 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/-/uFwj5hn2GP8J. For more options, visit https://groups.google.com/groups/opt_out.
On 13 March 2013 11:48, NN Dodhia <aca10nnd-1V21x8GFL1deXsq7+8kxVA@public.gmane.org> wrote:> Hi i have this code: > <div class ="radio"> > <%= radio_button_tag(:milk_code,"Full.", :checked =>(:milk_code > ==''Full.'')) %> > <%= label_tag(:milk_code1, "Full") %> > > <%= radio_button_tag(:milk_code,"Milk.",:checked =>(:milk_code => ''Skim''))%> > <%= label_tag(:milk_code2, "Skim") %> > > <%= radio_button_tag(:milk_code,"Semi-Skim'')) %> > <%= label_tag(:milk_code3, "Semi-Skim") %> > > But when i submit my form and check the database the value in milk_code is > not saved, any ideas? Also milk_code and milk_code1,2,3 are boolean.Have a look at the Rails Guide on Debugging which will show you techniques that you can use to debug your code. The first thing to do (which is the case when debugging any code) is to find which bit is failing. You can look in the log to check that the correct data is being posted and then use the debugging techniques in the controller to see why it is not being saved. 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 > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/ctaTsEst1FIJ. > 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.