INCLUDE_DATA

vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb:602:in `date_or_time_select’

Am I the only person in the world with this problem? I searched all over the web for a fix, but no one was even talking about it. The error I get is:

ArgumentError in My/profiles#show
wrong number of arguments (2 for 1)

I am running Rails 2.1, and putting a run-of-the-mill date_select crashes with the error shown in the title. I scratched my head at first, then banged it against the wall. I don’t know how this could be broken, but here is how I monkey-patched it.

Create a file in config/initializers and call it anythingyouwant.rb, and paste this in:

module ActionView
  module Helpers
    class InstanceTag #:nodoc:
      def to_date_select_tag(options = {}, html_options = {})
        date_or_time_select(options.merge(:discard_hour => true))
      end
    end
  end
end

That should fix it.