You must specify custom attributes as fourth arguments, parameters. The first three arguments are: name, value = "1", checked = false. See check_box_tag .
The code may be like this:
<%= check_box_tag :name, 1, false, data: { "toggle-completed" => "" } %>
Yanhao
source share