L
laredotornado
Hi,
I'm trying to build a search form with a date input field, displayed
like this:
<%= date_select
purchase_date, params[
urchase_date]) %>
But I'm having trouble adding the criteria in my controller. So far,
I have:
if !search[
urchase_date].blank?
conditions << 'purchase_date >= ?'
conditions << "#{search[
urchase_date]}"
end
find
all, :conditions => conditions,
age => {:size
=> page_size, :current => page_num} )
But the query gets run in a weird way, below:
SELECT count(ec_orders.id) AS count_ec_orders_id FROM `ec_orders`
WHERE purchase_date >= '(3i)24(1i)2006(2i)2')
What is the right way to get the date to be displayed normally in the
SQL query? - Dave
I'm trying to build a search form with a date input field, displayed
like this:
<%= date_select
But I'm having trouble adding the criteria in my controller. So far,
I have:
if !search[
conditions << 'purchase_date >= ?'
conditions << "#{search[
end
find
=> page_size, :current => page_num} )
But the query gets run in a weird way, below:
SELECT count(ec_orders.id) AS count_ec_orders_id FROM `ec_orders`
WHERE purchase_date >= '(3i)24(1i)2006(2i)2')
What is the right way to get the date to be displayed normally in the
SQL query? - Dave