It seems to be that "birthday_date" may not be an object but a
variable.
date_select expects an object_name as the first parameter and the
method in the second
date_select(object_name, method, options)
If you are not passing in an object, perhaps you should try
select_date helper instead. Something like:
select_date(birthday_date, { :start_year => 1900, :end_year =>
Time.now.year, :order =>> [:month, :day, :year], :include_blank => true, })
Just my guess.
steve
On Jul 8, 2:47 pm, John
<jbennet...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Is is possible to have both a default value specified, and to include
> a blank in a date_select?
>
> <%= date_select(''birthday_date'',
''value'', {:default =>
> birthday, :start_year => 1900, :end_year => Time.now.year, :order
=>
> [:month, :day, :year], :include_blank => true, }) %>
>
> This should technically include a blank option, and when the page
> loads it should select to the date that is being passed in.
>
> However, when I pass in a valid birthday that is a DateTime object,
> the select defaults to the blank values instead of the dates in the
> datetime object. If I take out the :include_blank => true statement,
> it default to the birthday correctly.
>
> Is this intended functionality? If so, is there any way to achieve
> what I am trying to do?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---