How do you say something happened "x minutes ago" or "x hours ago" or "x days ago" in Ruby?
formatting, ruby, time
Solution
If you are on rails:
time_ago_in_words
Problem
If I have a time variable in Ruby, how could I say that it refers to an event that happened one of the following: "x minutes ago" or "x hours ago" or "x days ago" Obviously if something happened 2 days ago, I would not want to say it happened such-and-such minutes ago.