title: How to make dropdown select search field to work, when using the Ransack gem on Rails?
body: <p>I'm using the Ransack gem on Ruby on Rails 4.2.2.</p>
  
  <p>The :name field search works, but I can't get the dropdown select field to work. When I select an item from the dropdown menu and press 'Search', I don't get any search results. This is what I get on the terminal:</p>
  
  <pre><code>Started GET "/companies?utf8=%E2%9C%93&amp;q%5Bname_cont%5D=&amp;..." for ...
  Processing by CompaniesController#index as HTML
  Parameters: {"utf8"=&gt;"✓", "q"=&gt;{"name_cont"=&gt;"", "category_eq"=&gt;"7", "location_eq"=&gt;""}, "commit"=&gt;"Search"}
  Company Load (0.3ms)  SELECT "companies".* FROM "companies"
  CACHE (0.0ms)  SELECT "companies".* FROM "companies"
  Company Load (0.1ms)  SELECT "companies".* FROM "companies" WHERE "companies"."category" = '7'
  Rendered companies/index.html.erb within layouts/application
  Completed 200 OK in 217ms 
  </code></pre>
  
  <p>Here is my companies_controller.rb</p>
  
  <pre><code>class CompaniesController &lt; ApplicationController
    def index
      @search = Company.search(params[:q])
      @companies = @search.result
    end
  end
  </code></pre>
  
  <p>Here is the index.html.erb for companies:</p>
  
  <pre><code>    &lt;%= search_form_for @search do |f| %&gt; 
  
         &lt;div class="field"&gt;
           &lt;%= f.label :name_cont, 'Company Name' %&gt;
           &lt;%= f.text_field :name_cont, class: 'form-control' %&gt;
         &lt;/div&gt;
  
         &lt;div class="field"&gt;
           &lt;%= f.label :category_eq, 'Category' %&gt;
           &lt;%= f.select :category_eq, options_from_collection_for_select(Company.all, "id", "category", @search.category_eq) %&gt;
         &lt;/div&gt;
  
         &lt;div class="field"&gt;
           &lt;%= f.label :location_eq, 'Location' %&gt;
           &lt;%= f.select :location_eq, options_from_collection_for_select(Company.all, "id", "location", @search.location_eq) %&gt;
         &lt;/div&gt;
  
        &lt;div&gt;  
          &lt;%= f.submit "Search" %&gt;
        &lt;/div&gt;
  
    &lt;% end %&gt;
  
    &lt;% @companies.each do |company| %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;%= company.name %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= company.category %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= company.location %&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I can't figure out why :name works, but :category and :location don't display anything on search?</p>