HI I don''t understand what happen .. if I use the script/console :>> include ActionView::Helpers::DateHelper=> Object>> include GLoc=> Object>> time_ago_in_words(Time.now, include_seconds = false)=> "moins d''une minute" I get the correct answer.. but I I write in my view <%= time_ago_in_words(Time.now, include_seconds = false) -%> I get an error :wrong number of arguments (0 for 1) trace app/helpers/application_helper.rb:96:in `[]'' app/helpers/application_helper.rb:96:in `distance_of_time_in_words'' seems no argument is passed .. ?? what''s wrong in the view ? thanks for your advices -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 20 May 2008, at 14:32, Kad Kerforn wrote:> > HI > > I don''t understand what happen .. > > if I use the script/console : >>> include ActionView::Helpers::DateHelper > => Object >>> include GLoc > => Object >>> time_ago_in_words(Time.now, include_seconds = false) > => "moins d''une minute" > > I get the correct answer.. > > but I I write in my view > > <%= time_ago_in_words(Time.now, include_seconds = false) -%> > > I get an error :wrong number of arguments (0 for 1) > > trace > app/helpers/application_helper.rb:96:in `[]'' > app/helpers/application_helper.rb:96:in `distance_of_time_in_words'' >Seems like you''ve got something in application_helper overwriting the default distance_of_time_in_words. What''s on (and around) line 96 ? Fred> seems no argument is passed .. ?? what''s wrong in the view ? > > thanks for your advices > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 20 May 2008, at 14:32, Kad Kerforn wrote: > >>>> time_ago_in_words(Time.now, include_seconds = false) >> trace >> app/helpers/application_helper.rb:96:in `[]'' >> app/helpers/application_helper.rb:96:in `distance_of_time_in_words'' >> > Seems like you''ve got something in application_helper overwriting the > default distance_of_time_in_words. What''s on (and around) line 96 ? > > Fredthanks a lot Fred... I forgot to delete a previous distance_of_time_in_words method used before implementing the GLoc plugin for translation...... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---