mardi 19 mai 2015

rails4 form checkbox is giving issue

Hi I want to show a checkbox in which if value is true then itshows unchecked and if value is false then it shows checked. I am having is_active field as boolean which accepts 0 or1 . So if employee is_active = 1 then my checkbox must show unchecked if value is 0 then it show checked. How to do this am not getting it. I have written like this:

<%= f.check_box :is_active %>

so for this if its 1 then shows checked which I dont want. Please help me out. Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire