Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashchan/timeago-rails
Use smart-time-ago with your Rails 3 app.
https://github.com/ashchan/timeago-rails
Last synced: about 2 months ago
JSON representation
Use smart-time-ago with your Rails 3 app.
- Host: GitHub
- URL: https://github.com/ashchan/timeago-rails
- Owner: ashchan
- License: mit
- Archived: true
- Created: 2012-10-03T04:42:57.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-28T22:59:04.000Z (about 11 years ago)
- Last Synced: 2024-07-22T07:45:32.018Z (2 months ago)
- Language: Ruby
- Size: 147 KB
- Stars: 29
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
timeago-rails
=============Use [smart-time-ago](http://pragmaticly.github.com/smart-time-ago/) with your Rails 3 app.
Installation
------------1. Add `gem 'timeago-rails'` to your Gemfile.
1. Run `bundle install`.
1. Add `//= require timeago` to your Javascript manifest file, after `//= require jquery`.Usage
-----````
<%= content_tag :time, '', class: 'timeago', datetime: 2.days.ago.iso8601 %>
$('.timeago').timeago();
````Note that smart-time-ago parses **ISO8601** timestamp.
See the [Usage](https://github.com/pragmaticly/smart-time-ago#usage) section on the smart-time-ago project.
*TODO: Perhaps should add view helper for creating timeago element?*
License
---------Released under the MIT License
smart-time-ago [License](https://github.com/pragmaticly/smart-time-ago/blob/master/LICENSE)
Credits
-------Thanks to [Pragmatic.ly](http://pragmatic.ly) for developing such an awesome plugin.
Copyright (c) 2012 [James Chen](http://ashchan.com/)