如何更改简单表单生成的输入元素的顺序?
因为隐藏的复选框确实会阻止单击标签。
我的 simple_form 代码:
<label>
<span>Company<b></b></span>
<%= f.check_box :company_is_true %>
</label>
表单简单表单生成:
<label>
<span>Company<b>0</b></span>
<input type="hidden" value="0" name="search[company_is_true]">
<input type="checkbox" value="1" name="search[company_is_true]" id="search_company_is_true">
</label>
我要生成的,在单击标签时有效:
<label>
<span>Company<b>0</b></span>
<input type="checkbox" value="1" name="search[company_is_true]" id="search_company_is_true">
<input type="hidden" value="0" name="search[company_is_true]">
</label>