Problem with date_select after Rails 2.1 upgrade

Folks,

I think I should start a new thread for this, because a similar one I
saw is a bit old and the resolution there doesn’t seem to apply to
what I’m running into now.

Anyway, my date_select calls are bombing on me with the exception:


ActionView::TemplateError (wrong number of arguments (3 for 2)) on
line #8 of entries/_dates_form.haml:
8: = date_select( ‘context’, ‘start_date’, {:start_year =>
2007, :order => [:month, :day, :year], :use_short_month =>
true, :include_blank => false})

vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb:

655:in select_year' vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb: 655:insend’
vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb:
655:in `date_or_time_select’

If I dig into DateHelper with the debugger, this appears to be the
line that’s bombing out:

/Users/wgray/Documents/Sources/Rails/tempo/vendor/rails/actionpack/lib/
action_view/helpers/date_helper.rb:655
date_or_time_select.insert(0, self.send(“select_#{param}”, datetime,
options_with_prefix(position[param], options.merge(:use_hidden =>
discard[param])), html_options))

(rdb:1) eval self.send(“select_#{param}”, datetime,
options_with_prefix(position[param], options.merge(:use_hidden =>
discard[param])), html_options)
ArgumentError Exception: wrong number of arguments (3 for 2)

I can’t seem to find a way to step into, or down into select_year
without the exception bubbling up on me and ending the investigation.
Using step gets me to the end of otpions_with_prefix, but when I come
back up, I can only seem to execute the send call, which then bombs.
But anyway, my call to date_select is nothing weird, and I have no
plugins over-riding its behavior:

= date_select( 'context', 'start_date', {:start_year =>

2007, :order => [:month, :day, :year], :use_short_month =>
true, :include_blank => false})

Nothing fancy. Anybody know what might have changed since Rails 2.0.2
to cause this?

Regards,
Billy

ArgumentError Exception: wrong number of arguments (3 for 2)

I can’t seem to find a way to step into, or down into select_year
without the exception bubbling up on me and ending the investigation.
Using step gets me to the end of otpions_with_prefix, but when I come
back up, I can only seem to execute the send call, which then bombs.
But anyway, my call to date_select is nothing weird, and I have no
plugins over-riding its behavior:

But are their plugins overriding some other ActionView internals? Just
about everytime someone has had similar problems its always turned out
to be a plugin or monkey patch to some internal function.

Fred

So I went looking further, because as you say, that definitely sounds
like the problem.

Aaaand D’OH! We had a monkey patch for select_year at the bottom of
application_helper.rb :wink:

I’ve moved that bad boy over to initializers/date_helper.rb with our
other patches and added the third html_options param, works like a
charm now.

Thanks Frederick!

On Jun 26, 3:33 pm, Frederick C. [email protected]