How I can display a timer, like google do with “(0.33 seconds)”, on
each page?
Thanks
How I can display a timer, like google do with “(0.33 seconds)”, on
each page?
Thanks
I just put up a plugin today to do just that:
http://www.agilewebdevelopment.com/plugins/timer
V/r
Anthony E.
On 11/14/06, rosoft2001 [email protected] wrote:
–
Email: [email protected]
Cell: 808 782-5046
Current Location: Melbourne, FL
This works for me:
in app/controllers/application.rb:
class ApplicationController < ActionController::Base
before_filter :set_start_time
def set_start_time
@start_time = Time.now
end
end
in app/views/layouts/application.rb (preferably after
@content_for_layout is
called):
<%= “Time: #{Time.now - @start_time} seconds” %>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs