Topic: datetime for a search
not too dissimilar to brusulaf's question...
trying to select and display orders in a table based on this:
<%= form_tag :action => 'orders_today' %>
Date to search: <%= select_datetime(date = Time.now, :prefix => "order_date") %>
<%= submit_tag "submit" %>
which when displayed in view returns this :
"month11minute01hour15day26year2006" (called by - <%= @order_date %>)
this gets what I want in the controller: - '2006-11-22 11:37:58.0' is the value of 'created_at' in the orders table
@orders = Order.find(:all, :conditions => ['created_at < ?', '2006-11-22 11:37:58.0'], :order => "created_at DESC")
but I want to do something like this:
@orders = Order.find(:all, :conditions => ['created_at < ?', @order_date ], :order => "created_at DESC")
Do I really need to parse and convert both the params[:order_date] and the 'created_at' in order to compare them?