Dylan Markow
2006-Jul-20 06:32 UTC
[Rails] 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? -- Posted via http://www.ruby-forum.com/.
Dylan Markow 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