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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -