Class: UserNotificationPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- UserNotificationPresenter
- Defined in:
- app/presenters/user_notification_presenter.rb
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary (collapse)
Methods inherited from BasePresenter
Constructor Details
This class inherits a constructor from BasePresenter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BasePresenter
Instance Method Details
- (Object) buttons
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/presenters/user_notification_presenter.rb', line 26 def rc = unless user_notification. ( 'mark-read', I18n.translate(:mark_read), (user_notification.created_at.to_i)) else ( 'mark-unread', I18n.translate(:mark_unread), show_notification_path(user_notification.created_at.to_i)) end rc += ('destroy', I18n.translate(:destroy), user_user_notification_path(current_user, user_notification.id), confirm: I18n.translate(:are_you_sure), method: :delete, id: 'delete-link') if can? :manage, user_notification end |
- (Object) head
5 6 7 8 9 10 11 |
# File 'app/presenters/user_notification_presenter.rb', line 5 def head content_tag :h3, class: "#{user_notification. ? 'marked-read' : 'marked-unread'}" do link_to (user_notification.created_at.to_s(:short)+": "+ user_notification..paragraphs.first + " ..." ), '#' end end |
- (Object) message
20 21 22 23 24 |
# File 'app/presenters/user_notification_presenter.rb', line 20 def content_tag :div do ContentItem::markdown(user_notification.) end end |
- (Object) message_with_buttons
13 14 15 16 17 18 |
# File 'app/presenters/user_notification_presenter.rb', line 13 def content_tag :div do ContentItem::markdown(user_notification.) + end end |