Module: Presenters::Timeable

Overview

Date/time rendering helpers for record presenters — created_at /
updated_at formatted via the view helper's render_datetime.

Instance Method Summary collapse

Instance Method Details

#created_atString

Formatted created_at timestamp of the wrapped record.

Returns:

  • (String)

    rendered datetime



13
14
15
# File 'app/concerns/presenters/timeable.rb', line 13

def created_at
  h.render_datetime(r.created_at)
end

#updated_atString

Formatted updated_at timestamp of the wrapped record.

Returns:

  • (String)

    rendered datetime



20
21
22
# File 'app/concerns/presenters/timeable.rb', line 20

def updated_at
  h.render_datetime(r.updated_at)
end