title: How can my forms checkboxes keep their state after a submit and page reload?
body: <p>I have a form consisting of checkboxes which is filtering records on an index page, how can I make the checkboxes in the form keep their checked state once the form is submitted and the page is reloaded?</p>
  
  <p>I'm already using jQuery-UI to make the checkboxes look better. Im super new to any kind of programming and having less luck with javascript.</p>
  
  <p><b>index.html.erb</b></p>
  
  <pre><code>&lt;script&gt;    
    $(function() {
      $(".areas").buttonset();
    });
  
    $(function() {
      $( "button, input:submit, a", ".filter_form_button" ).button();
      $( "a", ".form_filter_button" ).click(function() { return false; });
    });
  &lt;/script&gt;
  
  &lt;div class="filter_options_container"&gt;
    &lt;%= form_tag '', :method =&gt; :get, :id =&gt; 'filter_form' do %&gt;        
  
      &lt;fieldset class="filter_form_fieldset areas"&gt;
        &lt;% Area.all.each do |a| %&gt;
          &lt;p class="area_check"&gt;&lt;%= check_box_tag 'areas[]', a.id, false, :id =&gt; "area-#{a.id}" %&gt;
          &lt;label for="area-&lt;%= a.id %&gt;"&gt;&lt;p1&gt;&lt;%= a.name %&gt;&lt;/p1&gt;&lt;/label&gt;&lt;/p&gt;
        &lt;% end %&gt;
      &lt;/fieldset&gt;
  
      &lt;div class="filter_form_button"&gt;
        &lt;p2&gt;&lt;input type="submit" value="Filter"/&gt;&lt;/p2&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Any help with this is much appreciated!</p>