Rails 2.1 and ddatetime_select

I’ve updated to 2.1 and am continuing to have issues with
datetime_select helpers which worked fine previously.

Example:
<% form_remote_tag(:url => { :controller => ‘notes’,
:action
=> :add_booking_note_ajax,
:id => @booking},
:html
=>{:id=>‘new_booking_note’}) do %>
<%= datetime_select(:note, :follow_up, :discard_second =>
true, :minute_step => 15) %>
<%= text_area ‘note’, ‘body’, :rows => “7” %>
<%= submit_tag ‘Save’%>
<% end %>

Results in: ActionView::TemplateError (wrong number of arguments (2
for 1))

I get the same result with date_select as well. Any help would be
appreciated, thanks.

On Jun 9, 5:54 am, Hugh [email protected] wrote:

I’ve updated to 2.1 and am continuing to have issues with
datetime_select helpers which worked fine previously.

Random guess: You’ve got a plugin that overrides certain view helper
methods

Fred

Bingo, I replaced my old 12_hour plugin with this one:
http://code.google.com/p/rails-twelve-hour-time-plugin/ and it all
works. Thanks.

On Jun 9, 12:21 am, Frederick C. [email protected]

Fellas,

I also just updated to 2.1 from 2.0.2, seems I have a similar problem,
but I don’t have any view helper plugins involved:

ArgumentError in Entries#index wrong number of arguments (3 for 2)

8: = date_select( ‘context’, ‘start_date’, {:start_year =>
2007, :order => [:month, :day, :year], :use_short_month =>
true, :include_blank => false})

According to the API, this should still be valid, so I’m guessing the
error is something else.

I do have an override of a DateHelper method so that my selects can
actually have unique dom IDs, but I just compared the old and new
versions of the DateHelper method I’m overriding, and they don’t
appear to have changed:

Rails 2.1:
def name_and_id_from_options(options, type)
options[:name] = (options[:prefix] || DEFAULT_PREFIX) +
(options[:discard_type] ? ‘’ : “[#{type}]”)
options[:id] = options[:name].gsub(/([[(])|(][)/,
‘_’).gsub(/[])]/, ‘’)
end

Rails 2.0.2:
def name_and_id_from_options(options, type)
options[:name] = (options[:prefix] || DEFAULT_PREFIX) +
(options[:discard_type] ? ‘’ : “[#{type}]”)
options[:id] = options[:name].gsub(/([[(])|(][)/,
‘_’).gsub(/[])]/, ‘’)
end

My override in initializers/date_helper.rb:

module ActionView
module Helpers
module DateHelper
def name_and_id_from_options(options, type)
options[:name] = (options[:prefix] || DEFAULT_PREFIX) +
(options[:discard_type] ? ‘’ : “[#{type}]”)
name = options[:name].gsub(/([[(])|(][)/, '’).gsub(/[]
)]/, ‘’)
unless options[:id].nil?
options[:id] = name.sub(/
/, “#{options[:id]}”)
else
options[:id] = name
end
end
end
end
end

Any help is gladly appreciated!

Cheers,
Billy