How to use options in radio botton

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

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 S. wrote:


Sincerely,

William P.

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 P. wrote:

my code…


Sincerely,

William P.

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