title: Using checkboxes to filter records
body: <p>I am trying to learn rails from zero programming experience and have an app im trying to make. With much help from people on here, I have an index page of venues which are filterable by which area they belong to via a dropdown menu. I would like to be able to have the same affect but using checkboxes and also being able to select multiple areas to add to the filter. This is what I have so far:</p>
  
  <p>Model :</p>
  
  <pre><code>class Venue &lt; ActiveRecord::Base
    belongs_to :user
    has_many :reviews
    belongs_to :area
  
    scope :north, where(:area_id =&gt; "2")
    scope :west, where(:area_id =&gt; "3")
    scope :south, where(:area_id =&gt; "4")
  end
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>def index
    if (params[:area] &amp;&amp; Area.all.collect(&amp;:name).include?(params[:area][:name]))
      @venues = Venue.send(params[:area][:name].downcase)
    else
      @venues = Venue.all
    end
  end
  </code></pre>
  
  <p>Venues index.html.erb:</p>
  
  <pre><code>&lt;div class="filter_options_container"&gt;
  
    &lt;form class="filter_form", method="get"&gt;
      &lt;%= select("area", "name", Area.all.collect(&amp;:name), {:prompt =&gt; 'All Areas'}) %&gt;&lt;br&gt;
      &lt;input type="submit" value="Filter" /&gt;
    &lt;/form&gt;
  
    &lt;br&gt;&lt;br&gt;
  
    &lt;form class="filter_form", method="get"&gt;
      &lt;% Area.find(:all).each do |a| %&gt;
        &lt;%= check_box_tag("area", "name") %&gt;
        &lt;%= a.name %&gt;
      &lt;% end %&gt;
      &lt;input type="submit" value="Filter" /&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;div class="venue_partials_container"&gt;
    &lt;%= render :partial =&gt; 'venue', :collection =&gt; @venues %&gt;
    &lt;div class="clearall"&gt;&lt;/div&gt;
    &lt;%= link_to 'add a new venue', new_venue_path, :class =&gt; "add_new_venue_button" %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The first form (the dropdowns) in the filter_options_container works fine but the checkboxes (the second form) is returning "can't convert Symbol into Integer" what am I missing/doing wrong?</p>
  
  <p>Thankyou for any help.</p>