What's wrong with this select_date?

Following line of code renders a set of data selects, and everything
about it works perfectly except that it refuses to set the order of the
date field to day, month and then year. I get the default year, month
day instead. What could I be doing wrong?

<%= select_date status_date.status_date, { :order => [:day, :month,
:year] } %>

It looks like the :order argument for select_date was added for Rails
1.2. Are you running a pre-1.2 version of rails?

1.1.6 version

Returns a set of html select-tags (one for year, month, and day) pre-

selected with the +date+.
def select_date(date = Date.today, options = {})
select_year(date, options) + select_month(date, options) +
select_day(date, options)
end

1.2.2 version

Returns a set of html select-tags (one for year, month, and day) pre-

selected with the +date+.

It’s possible to explicitly set the order of the tags using the

:order option with an array of

symbols :year, :month and :day in the

desired order. If you do not supply a Symbol, it

will be appened onto the :order passed in.

def select_date(date = Date.today, options = {})
options[:order] ||= []
[:year, :month, :day].each { |o| options[:order].push(o) unless
options[:order].include?(o) }

select_date = ‘’
options[:order].each do |o|
select_date << self.send(“select_#{o}”, date, options)
end
select_date
end

Aaron

Yep, that must be the problem. I haven’t updated rails for a little
while on my development machine. Duh. Thanks for your help.