title: Select_tag with elasticsearch
body: <p>I try to pass 2 options for search. First [:q] for input text by visitor and another one from model camping "nomdep" (like departement in english). When i try to search by input it's works, but since i try to add select_tag i have an error</p>
  
  <p><strong>ERROR</strong>
  <em>undefined method `map' for nil:NilClass</em></p>
  
  <p>I m lost, do u have any ideas ?</p>
  
  <p>Sorry for my english, i m french.</p>
  
  <p>Home_controler.rb</p>
  
  <pre><code> def index
        if params[:q].nil?
          "Entrez un mot clef"
        else
          @campings = Camping.__elasticsearch__.search params[:q,:nomdep]
          @camping = Camping.all
      end
      end
  
  def result
        if params[:q].nil?
          @campings = []
        else
          @campings = Camping.__elasticsearch__.search(params[:q]).page(params[:page]).per(14).results
        end
  end
  </code></pre>
  
  <p>View</p>
  
  <pre><code>&lt;div class="search"&gt;
          &lt;%= form_tag(result_path, method: :get) %&gt;
          &lt;%= text_field_tag :q, params[:q], class:"search-query form-control" %&gt;
                      &lt;%= select_tag(:nomdep, options_for_select(@camping)) %&gt;
  
                &lt;%= submit_tag "Partez", class:"btn btn-danger", name: nil %&gt;
      &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT</strong>
  Now i dont have any error but the search dont work if [:q] empty. So if i only select_tag => no result. </p>
  
  <p>How fix this ?</p>
  
  <p>My full home_controller.rb</p>
  
  <pre><code>class HomeController &lt; ApplicationController
    def index
        @camping = Camping.all
        if params[:q].nil?
          "Entrez un mot clef"
        else
          @campings = Camping.__elasticsearch__.search params[:q, :nomdep]
      end
      end
  
    def result
        if params[:q].nil?
          @campings = []
        else
          @campings = Camping.__elasticsearch__.search(params[:q]).page(params[:page]).per(14).results
        end
  
  end
  end
  </code></pre>
  
  <p>my view</p>
  
  <pre><code>&lt;div class="search"&gt;
              &lt;%= form_tag(result_path, method: :get) %&gt;
                          &lt;%= select_tag :nomdep, options_from_collection_for_select(@camping, :id, :nomdep), prompt: "Département" %&gt;
                    &lt;%= text_field_tag :q, params[:q], class:"search-query form-control" %&gt;
                    &lt;%= submit_tag "Partez", class:"btn btn-danger", name: nil %&gt;
          &lt;/div&gt;
  </code></pre>