How to make a check_box checked in rails?

Here’s how to do it as of rails 4, I didn’t check older documentation.

<%= check_box("tag", tag.id, {checked: true}) %>

This will make the checkbox checked. Of course instead of true you will put in some logic which determines if each one is checked.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)