title: date search and textfield format ruby
body: <p>Here the thing, i'm doing a DATE search in rails using textfield, but when I use date_select instead of text_field_tag the search don't work. There is a function that I have that maybe is getting problems. Here the code.  </p>
  
  <p>Controller  </p>
  
  <pre><code>if self.is_date(params[:s_fec_min])
  @items = View_item.all.order("fec_vencimiento ASC").page(params[:page]).per(15).search_fec_min(params[:s_codigo], params[:s_den_cont], params[:s_marca], params[:s_fec_min])
  
  
  def is_date(temp)
  begin
    return true if Date.parse(temp)
      rescue
       return false
    end
  end  
  </code></pre>
  
  <p>Index.html  </p>
  
  <pre><code>&lt;%= date_select :s_fec_min, params[:s_fec_min], :include_blank =&gt; true %&gt;  
  #&lt;%= text_field_tag :s_fec_min, params[:s_fec_min] %&gt;  
  </code></pre>
  
  <p>The first one didn't work, the second one works good</p>
  
  <p>View_item</p>
  
  <pre><code>def self.search_fec_min(s_codigo, s_den_cont, s_marca, s_fec_min)  
  where("codigo ilike :s_c and den_cont ilike :s_d and marca ilike :s_m and fec_vencimiento &gt;= :s_fmin", s_c: "%#{s_codigo}%", s_d: "%#{s_den_cont}%", s_m: "%#{s_marca}%", s_fmin: "#{s_fec_min}")
  end  
  </code></pre>
  
  <p>I also tried with DateTime in the function but no effect. Can anyone have a suggestion?. Tks</p>
  
  <p>UPDATE
  I added # as mencioned but of course that is not the problem, just forgot to comment that line here, in my app is commnet.</p>