Hi I am running rails 1.2.3 and am getting - NoMethodError in Chapter3Controller#get_time undefined method `size'' for Time:Class RAILS_ROOT: script/../config/.. - I do this in my controller -CODE- def get_time sleep 1.second render :text => Time end If I do this -CODE_ def get_time sleep 1.second render :text => Time.now end I am getting this message: NoMethodError in Chapter3Controller#get_time undefined method `size'' for Tue May 15 15:29:22 +1200 2007:Time RAILS_ROOT: script/../config/.. There appears to be a problem in the Time class. Can anyone help? Thanks, Paul Thompson --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try "render :text => Time.now.to_s" b Paul Jonathan Thompson wrote:> Hi > > I am running rails 1.2.3 and am getting - NoMethodError in > Chapter3Controller#get_time > > undefined method `size'' for Time:Class > > RAILS_ROOT: script/../config/.. - > > I do this in my controller -CODE- > > def get_time > sleep 1.second > render :text => Time > end > > If I do this -CODE_ > > def get_time > sleep 1.second > render :text => Time.now > end > > I am getting this message: NoMethodError in Chapter3Controller#get_time > > undefined method `size'' for Tue May 15 15:29:22 +1200 2007:Time > > RAILS_ROOT: script/../config/.. > > There appears to be a problem in the Time class. Can anyone help? > > Thanks, > > Paul Thompson > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanx Ben, that worked. Funny though, I am working through the AJAX on Rails book and it is not shown like that in any of there examples. On 15/05/07, Ben Munat <bmunat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Try "render :text => Time.now.to_s" > > b > > Paul Jonathan Thompson wrote: > > Hi > > > > I am running rails 1.2.3 and am getting - NoMethodError in > > Chapter3Controller#get_time > > > > undefined method `size'' for Time:Class > > > > RAILS_ROOT: script/../config/.. - > > > > I do this in my controller -CODE- > > > > def get_time > > sleep 1.second > > render :text => Time > > end > > > > If I do this -CODE_ > > > > def get_time > > sleep 1.second > > render :text => Time.now > > end > > > > I am getting this message: NoMethodError in Chapter3Controller#get_time > > > > undefined method `size'' for Tue May 15 15:29:22 +1200 2007:Time > > > > RAILS_ROOT: script/../config/.. > > > > There appears to be a problem in the Time class. Can anyone help? > > > > Thanks, > > > > Paul Thompson > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---