Generate custom attributes in check_box_tag
You must give the custom attributes as fourth arguments, options. The first three arguments are name, value = "1", checked = false. See check_box_tag.
The code could be like this:
<%= check_box_tag :name, 1, false, data: { "toggle-completed" => "" } %>