Module: MaintenanceTasks::ApplicationHelper Private
- Defined in:
- app/helpers/maintenance_tasks/application_helper.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Module for common view helpers.
Instance Method Summary collapse
-
#time_ago(datetime) ⇒ String
private
Renders a time element with the given datetime, worded as relative to the current time.
Instance Method Details
#time_ago(datetime) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Renders a time element with the given datetime, worded as relative to the current time.
The ISO 8601 version of the datetime is shown on hover via a title attribute.
16 17 18 19 20 |
# File 'app/helpers/maintenance_tasks/application_helper.rb', line 16 def time_ago(datetime) time_tag(datetime, title: datetime.utc.iso8601, class: "is-clickable") do time_ago_in_words(datetime) + " ago" end end |