title: Ruby on Rails undefined method 'to_datetime'
body: <p>I tried to compare values from View with created_at from DB, but i have this problem <b>"undefined method `to_datetime' for {"year"=>"2015", "month"=>"11", "day"=>"7"}:ActionController::Parameters"</b>. I have no ideas.</p>
  
  <p>Controller:</p>
  
  <pre><code>def data_search
      @SDB=[]
      startt=params[:start_date].to_datetime
      endt=params[:end_date].to_datetime
      Offer.where(created_at: [startt..endt]).each do |f|
          @SDB.push(f)
      end
  end
  </code></pre>
  
  <p>Segment from search.html.erb:</p>
  
  
  
  <pre><code>        &lt;%= select_date Date.today, :prefix =&gt; :start_date %&gt; 
          &lt;%= select_date Date.today, :prefix =&gt; :end_date%&gt; 
  </code></pre>
  
  <p>Without 'to_datetime' i have <b>bad value for range</b></p>