user1401379
user1401379

Reputation:

Ruby on Rails - Time

At the moment, after I post something in Rails, the time format is

<time><%= post.created_at.to_formatted_s(:day_month_year) %></time>

How can I get it to say "about 6 minutes ago"?

Upvotes: 0

Views: 165

Answers (1)

Nick Colgan
Nick Colgan

Reputation: 5518

<time><%= time_ago_in_words(post.created_at) %> ago</time>

Upvotes: 6

Related Questions