Notes posted by kasper_grubbe
RSS feed
3 thanks
Use strings as parameters, not booleans
I just stumbled across this somewhere in our codebase. The first example is faulty, the second one is correct.
= f.check_box :public, {}, true, false # <input id="event_public" name="event[public]" type="checkbox" value="true" />
and:
= f.check_box :public, {}, "true", "false" # <input name="event[public]" type="hidden" value="false" /> # <input id="event_public" name="event[public]" type="checkbox" value="true" />