Module: TimeagoHelper
- Defined in:
- app/helpers/timeago_helper.rb
Instance Method Summary collapse
Instance Method Details
#timeago(time = nil, html_options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'app/helpers/timeago_helper.rb', line 2 def timeago(time = nil, = {}) time = time.to_time if time.is_a? String classes = ['timeago'] if [:class] classes << [:class] end [:class] = classes * ' ' [:title] = time.getutc.iso8601 content_tag(:abbr, time.try(:to_s), ) end |