Forum: Ruby on Rails Problem with date_select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex W. (Guest)
on 2006-05-10 00:40
Dates defined chosen with date_select are not coming through once the
form is submitted.

I have this in a form:

<%= date_select 'search', 'date_start', :include_blank => true %>
<%= date_select 'search', 'date_end'  , :include_blank => true %>

However, when I submit the form params[:search][:date_start] is nil.  I
have other text fields that are coming through just fine.  Somehow rails
isn't reassembling the date object.  Surely I dont have to create the
date object by hand.  My log shows the pieces of the date are indeed in
the request parameters.

So what do I need to do to actually access the date passed from the
form?

### parameters hash form log
Parameters: {"search"=>{"date_start(1i)"=>"2006", "date_start(2i)"=>"5",
"date_start(3i)"=>"4", "date_end(1i)"=>"2006", "first_name"=>"",
"login"=>"sq", "date_end(2i)"=>"5", "last_name"=>"", "email"=>"",
"date_end(3i)"=>"6"}, "commit"=>"Search", "action"=>"search",
"controller"=>"admin/orders"}
This topic is locked and can not be replied to.