Hi I am using radio botton,I am struggling to use options..following is my code.. <%radio_button(''community'',''default'',0,options={:checked,:onClick=>"javascript:set_default(this);"})%> If i am using without checked option its working fine.If i use that its throwing error.... Please help me -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You don''t need the "options=". That is just in the method definition to let you know that the final argument is defaulted to an empty hash. radio_button(''community'',''default'',0,{:checked,:onClick=>"javascript:set_default(this);"}) Selvaraj Subbaian wrote:> Hi I am using radio botton,I am struggling to use options..following is > my code.. > > <%> radio_button(''community'',''default'',0,options={:checked,:onClick=>"javascript:set_default(this);"})%> > > If i am using without checked option its working fine.If i use that its > throwing error.... > > Please help me >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
One more thing I noticed. You need to supply a value for the :checked key like :checked => true radio_button(''community'',''default'',0,{:checked => true,:onClick => "javascript:set_default(this);"}) William Pratt wrote:> You don''t need the "options=". That is just in the method definition to > let you know that the final argument is defaulted to an empty hash. > > radio_button(''community'',''default'',0,{:checked,:onClick=>"javascript:set_default(this);"}) > > > > Selvaraj Subbaian wrote: > >> Hi I am using radio botton,I am struggling to use options..following is >> my code.. >> >> <%>> radio_button(''community'',''default'',0,options={:checked,:onClick=>"javascript:set_default(this);"})%> >> >> If i am using without checked option its working fine.If i use that its >> throwing error.... >> >> Please help me >> >> > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---