ruby on rails - Change Checkbox return values -


i designing search page in rails using ransack , need check boxes.

i have several check boxes. here 1 of them.

<%= f.check_box :if_bt_eq %>bt

i know when check box ticked returns 1 , 0 when not ticked.

is there way in can change non-ticked return value nil ?

if not, can suggest sort of alternative this?

thanks!

update:

here's hashes passed when search form submit button clicked:

with check box ticked:

...q%5bif_bt_eq%5d=1&...

with check box not ticked:

...q%5bif_bt_eq%5d=0&...

i want check box not ticked be

...q%5bif_bt_eq%5d=&...


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -