title: How to dropdown select in rails form
body: <p>how to do dropdown select in rails form ?</p>
  
  <p>i tried to </p>
  
  <pre><code>&lt;div class="field"&gt;
       &lt;%= f.label :car_id %&gt;
      &lt;%= select("car", "car_id", @cars) %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :firstname %&gt;
      &lt;%= f.text_field :firstname %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :lastname %&gt;
      &lt;%= f.text_field :lastname %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :dateofbirth %&gt;
      &lt;%= f.date_select :dateofbirth %&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>but i get this error </p>
  
  <pre><code>undefined method `empty?' for nil:NilClass
  </code></pre>
  
  <p>at this line. </p>
  
  <pre><code>  &lt;%= select("car", "car_id", @cars) %&gt;
  </code></pre>