Dateformat: x minutes ago

26 views
Skip to first unread message

Martin Wawrusch

unread,
Jun 21, 2011, 1:55:57 AM6/21/11
to rubyonra...@googlegroups.com
Hi guys,

Is there a standard function/gem in rails that lets me format times in a facebookish way, like "x minutes ago"? Ideally one that works well together with a similar jquery library for live updates?

Thanks
Martin

Chris Kottom

unread,
Jun 21, 2011, 2:14:57 AM6/21/11
to rubyonra...@googlegroups.com
I don't know of a good gem solution (though it would be great if there were one because this is a problem that has been solved and re-solved too many times) but DHH did a blog post a few years back that explains exactly how to implement this in a relatively simple way.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Chirag

unread,
Jun 21, 2011, 4:17:24 AM6/21/11
to rubyonra...@googlegroups.com
Rails has inbuilt helpers for such kind of stuff.

Martin Wawrusch

unread,
Jun 21, 2011, 4:25:48 AM6/21/11
to rubyonra...@googlegroups.com
Awesome, thank you.

Rails rocks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/iFPKuAI-AHUJ.

To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.



-


Reply all
Reply to author
Forward
0 new messages