Module Rails::Timeago::Helper
In: lib/rails-timeago/helper.rb

Methods

Public Instance methods

Return a JavaScript tag to set jQuery timeago locale.

Create a time tag usable for jQuery timeago plugin.

  timeago_tag Time.zone.now
  => "<time datetime="2012-03-10T12:07:07+01:00"
            title="Sat, 10 Mar 2012 12:07:07 +0100"
            data-time-ago="2012-03-10T12:07:07+01:00">2012-03-10</time>"

Available options:

:nojs
Add time ago in words as time tag content instead of absolute time. (default: false)
:date_only
Only print date as tag content instead of full time. (default: true)
:format
A time format for localize method used to format static time. (default: :default)
:limit
Set a limit for time ago tags. All dates before given limit will not be converted. (default: 4.days.ago)
:force
Force time ago tag ignoring limit option. (default: false)
:default
String that will be returned if time is nil. (default: ’-’)

All other options will be given as options to tag helper.

[Validate]