Module: TimeagoHelper

Defined in:
app/helpers/timeago_helper.rb

Instance Method Summary collapse

Instance Method Details

#timeago(time, options = {}) ⇒ Object



2
3
4
5
6
# File 'app/helpers/timeago_helper.rb', line 2

def timeago(time, options = {})
  time = time.to_time if time.is_a? String
  options[:class] ||= 'timeago'
  (:abbr, time.to_s, options.merge(title: time.getutc.iso8601)) if time
end