Outputting date as "1 day ago" or "53 minutes ago"

When printing out the results of my “updated_at” field, I’d like to be
able to print it as “Updated 5 days ago” instead of “Updated on
7/14/06.”

I’ve seen many blogs do this, is there an easy way to do it through
rails / ruby?

Dylan M. wrote:

When printing out the results of my “updated_at” field, I’d like to be
able to print it as “Updated 5 days ago” instead of “Updated on
7/14/06.”

I’ve seen many blogs do this, is there an easy way to do it through
rails / ruby?

See time_ago_in_words:
http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M000467

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs