我在网上搜索并找不到办法.到目前为止,我尝试过:
<%= check_box_tag "course[location_ids][]", location.id, class: 'checkbox-inline'%>
Run Code Online (Sandbox Code Playgroud)
这将输出:
input type: "checkbox" name="course[location_ids][] id="course_location_ids_" value="1" checked="checked"
Run Code Online (Sandbox Code Playgroud)
出于某种原因,它会进行检查输入.
<%= check_box_tag "course[location_ids][]", location.id, :class => 'checkbox-inline'%>
Run Code Online (Sandbox Code Playgroud)
和第一个一样
如何在check_box_tag中添加类