I need to show natural dates like
- "few seconds ago"
- "21 minutes ago"
Is there something built in to the rails? Or may be third party? This is not hard to implement, but I do not want to invent the wheel.
I need to show natural dates like
Is there something built in to the rails? Or may be third party? This is not hard to implement, but I do not want to invent the wheel.
An interesting approach to consider is doing time-to-word conversion on the client side with javascript. This can keep your pages cacheable while still presenting relative times to the end user.
Darragh Curran has released a javascript implementation of just such functionality and written up a short explanation of how to use it in a Rails application.
Another interesting advantage of this technique is that you can dynamically update the description of the time without the user leaving the page.