I know this is a little late, but this is what I use in my view to display my posts:
<% if message.created_at > Time.now.beginning_of_day %> <%="#{time_ago_in_words(message.created_at)} ago"%> # 3 minutes ago, less than a minute ago <% else %> <%= message.created_at.strftime("%b %d, %Y") %> # Jun 29, 2012 <% end %>
Can be retrieved in a helper method. hope this helps
Hishalv
source share