Simple radio_button


#1

Hello, I’m having a problem with radio_button, I don’t know what I’m
doing wrong so please help me checking.
I need the “user” to select the kind of report to load, The options are
given with radio_buttons like this:

MES ACTUAL <%= radio_button 'tipo','mes', {:checked => 'true'} %> ANUAL <%= radio_button 'tipo','anual', {:checked => 'true'} %> ACUMULADO TOTAL <%= radio_button 'tipo','acumulado',{:checked => 1}%>

but they get loaded unchecked, if you check them, then you cant uncheck
them, and that is not what I want.
I just need the to work like simple radio_button that you can check or
unchek, and having to choose only one.

What is wrong?


#2

What is wrong?
I’m not sure that it’s radio buttons you need for this. Try
‘check_box’ instead.

Steve


#3

Never mind , I make it work,I change it to this:

MES ACTUAL <%= radio_button ('reporte','tipo', 'mes' ) %> ANUAL <%= radio_button ('reporte','tipo', 'anual') %> ACUMULADO TOTAL <%= radio_button ('reporte','tipo','acumulado',:checked=>true)%>

It seems that it needs to have the 2 first arguments name the same way
to work as I needed.

Thanks anyway