Sounds like you’re looking for the time_ago_in_words
method (or distance_of_time_in_words
), from ActiveSupport. Call it like this:
<%= time_ago_in_words(timestamp) %>
More Related Contents:
- How to prevent browser page caching in Rails
- ‘sudo gem install’ or ‘gem install’ and gem locations
- ActiveRecord: size vs count
- Altering the primary key in Rails to be a string
- How to extract URL parameters from a URL with Ruby or Rails?
- ruby/ruby on rails memory leak detection
- How can I uninstall Ruby on ubuntu?
- How do i work with two different databases in rails with active records?
- How to get a query string from a URL in Rails
- Is there a way to access method arguments in Ruby?
- Convert Time from one time zone to another in Rails
- Using Rails Migration on different database than standard “production” or “development”
- What is the use of Gemfile in rails?
- Rails Console: reload! not reflecting changes in model files? What could be possible reason?
- counter_cache with has_many :through
- Heroku not sending email with Gmail SMTP
- How can I specify a local gem in my Gemfile?
- How to set default values in Rails?
- What is the right way to override a setter method in Ruby on Rails?
- How do I display Ruby on Rails form validation error messages one at a time?
- Ruby / Rails – Change the timezone of a Time, without changing the value
- How do I use gems with Ubuntu?
- How to define action with simple form for?
- “gem install rails” fails with DNS error
- Rails: Skinny Controller vs. Fat Model, or should I make my Controller Anorexic?
- How can I solve this trouble to deploy a Rails App to Heroku?
- Rails 3 invalid multibyte char (US-ASCII)
- 403 Forbidden on Rails app w/ Nginx, Passenger
- How do I remove lines of data in the middle of a text file with Ruby
- How to fix “Your Ruby version is 2.3.0, but your Gemfile specified 2.2.5” while server starting