0.02
No commit activity in last 3 years
No release in over 3 years
The rails-livestamp is a simple jQuery plugin that provides auto-updating timeago text to your timestamped HTML elements, which will update automatically as time goes by. ISO 8601 timestamps are also supported.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.8
~> 10.0
 Project Readme

rails-livestamp Gem Version Gem Total Downloads

The rails-livestamp is a simple jQuery plugin that provides auto-updating timeago text to your timestamped HTML elements, which will update automatically as time goes by. ISO 8601 timestamps are also supported.

Installation

Add this line to your application's Gemfile:

gem 'rails-livestamp', '~> 1.1.3'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rails-livestamp

To use rails-livestamp add this require statement to your application.js file:

//= require rails-livestamp

Usage

No extra JavaScript required! Just use a <span> with the data-livestamp attribute set to the desired Unix timestamp (in seconds), like this:

If you use ERB:

You discovered rails-livestamp <span data-livestamp="#{Time.now.to_i}"></span>.

If you use HAML:

You discovered rails-livestamp 
%span{"data-livestamp" => "#{Time.now.to_i}"}.

And you will see something like this:

You discovered rails-livestamp a minutes ago. 

Wait half a minute - the livestamp will update automatically.

More Documentation.

See the livestamp documentation.

License

MIT License

Copyright (c) 2015 - Present, Matt Bradley ( Livestamp.js Maintainer ), Bunlong VAN ( Maintainer )