Saturday, May 17, 2008

Time Ago

Ever wanted to show the user that something happened so many minutes/hours/days/etc ago? Apparently, RoR makes it super simple to do this. There is a method called:

time_ago_in_words

Simply include the time (from now) that you want to calculate - perhaps a created_at/updated_at field.

Easy!


W

No comments: