Class: ActiveJob::Notificare::NotificationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ActiveJob::Notificare::NotificationsController
- Defined in:
- app/controllers/active_job/notificare/notifications_controller.rb
Instance Method Summary collapse
Instance Method Details
#clear ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/controllers/active_job/notificare/notifications_controller.rb', line 23 def clear @notifications = Notification.where(recipient: @current_recipient).visible.to_a Notification.where(id: @notifications.map(&:id)).destroy_all respond_to do |format| format.turbo_stream format.html { head :ok } end end |
#dismiss ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/active_job/notificare/notifications_controller.rb', line 15 def dismiss @notification.dismiss! respond_to do |format| format.turbo_stream format.html { head :ok } end end |
#read ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/active_job/notificare/notifications_controller.rb', line 7 def read @notification.mark_read! respond_to do |format| format.turbo_stream format.html { head :ok } end end |