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. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jun 9, 5:54 am, Hugh <h...-EcXoqBC4F/kd5Ot1ntKM6ZqQE7yCjDx5@public.gmane.org> 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> 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.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 9, 5:54 am, Hugh <h...-EcXoqBC4F/kd5Ot1ntKM6ZqQE7yCjDx5@public.gmane.org> 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 > > > 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.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Jun 10, 1:42 pm, Hugh <h...-EcXoqBC4F/kd5Ot1ntKM6ZqQE7yCjDx5@public.gmane.org> wrote:> 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 Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On Jun 9, 5:54 am, Hugh <h...-EcXoqBC4F/kd5Ot1ntKM6ZqQE7yCjDx5@public.gmane.org> 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 > > > > 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.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---