¶ ↑
HublotHublot makes Facebook-style datetime-contextual datetimes a cinch for your ActiveRecord objects.
¶ ↑
Examples¶ ↑
Comment created just now:just now
¶ ↑
Comment created seconds or minutes ago10 seconds ago 2 minutes ago
¶ ↑
Comment created todayToday at 5:30PM
¶ ↑
Comment created yesterdayYesterday at 5:30PM
¶ ↑
Comment created this weekMonday at 5:30PM
¶ ↑
Comment created last weekLast Monday at 5:30PM
¶ ↑
After that:Monday, July 1 at 5:30PM
¶ ↑
Usegem "hublot", "~> 0.0.6"
Call the pretty method in your views:
<%= @comment.created_at.pretty %>