Rails 4 collection_check_boxes persistent after form refresh
<p>I'm using Rails 4 <strong><a href="http://apidock.com/rails/v4.0.2/ActionView/Helpers/FormOptionsHelper/collection_check_boxes" rel="nofollow">collection_check_boxes</a></strong> in my forms. Filling out the form, I check some of the checkboxes. I've noticed that when the form refreshes after validation error, the checkboxes that were checked persists. Is this a feature of the tag? I couldn't find this information in the docs. </p>

<p>Checkbox form field code: </p>

<pre><code>&lt;div class="field"&gt;
  &lt;%= f.label "Area of Interest" %&gt;&lt;br /&gt;
  &lt;%= f.collection_check_boxes :interest_ids, Interest.all, :id, :name do |b| %&gt;
    &lt;div class="collection-check-box"&gt;
      &lt;%= b.check_box %&gt;
      &lt;%= b.label %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
&lt;/div&gt;
</code></pre>

<p>I do want the checkboxes to stay checked after form refresh but wanted to make sure it is a feature and not just a coincidence that is it working for me. </p>

<p>Any information would be helpful, thanks! </p>