Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Use smart-time-ago with your Rails 3 app.
Ruby JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
vendor/assets/javascripts
.gitignore
Gemfile
MIT-LICENSE
README.md
Rakefile
timeago-rails.gemspec

README.md

timeago-rails

Use smart-time-ago with your Rails 3 app.

Installation

  1. Add gem 'timeago-rails' to your Gemfile.
  2. Run bundle install.
  3. Add //= require timeago to your Javascript manifest file, after //= require jquery.

Usage

    <%= content_tag :time, '', class: 'timeago', datetime: 2.days.ago.iso8601 %>
    <script>
      $('.timeago').timeago();
    </script>

Note that smart-time-ago parses ISO8601 timestamp.

See the 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

Credits

Thanks to Pragmatic.ly for developing such an awesome plugin.

Copyright (c) 2012 James Chen

Something went wrong with that request. Please try again.