Module: Sage::ApplicationHelper
- Includes:
- Pagy::Frontend
- Defined in:
- app/helpers/sage/application_helper.rb
Instance Method Summary collapse
- #format_message_date(date) ⇒ Object
- #messages_grouped_by_day(messages) ⇒ Object
-
#sage ⇒ Object
Provide access to Sage engine routes.
Instance Method Details
#format_message_date(date) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/sage/application_helper.rb', line 15 def (date) case date when Date.current "Today" when Date.current - 1 "Yesterday" else if date.year == Date.current.year date.strftime("%B %d") else date.strftime("%B %d, %Y") end end end |
#messages_grouped_by_day(messages) ⇒ Object
10 11 12 13 |
# File 'app/helpers/sage/application_helper.rb', line 10 def () .group_by { || .created_at.to_date } .sort_by { |date, _| date } end |