后4个collection_check_boxes执着我使用Rails 4 collection_check_boxes在我的形式。填写表格,我检查一些复选框。我注意到,当表单在验证错误后刷新时,检查的复选框仍然存在。这是标签的功能吗?我无法在文档中找到这些信息。Rails的形式刷新
复选框表单域代码:
<div class="field">
<%= f.label "Area of Interest" %><br />
<%= f.collection_check_boxes :interest_ids, Interest.all, :id, :name do |b| %>
<div class="collection-check-box">
<%= b.check_box %>
<%= b.label %>
</div>
<% end %>
</div>
我想复选框留形式刷新后检查,但希望确保它是一个功能,而不是只是一个巧合,是不是为我工作。
的任何信息将是有益的,谢谢!