Class: Decidim::NotificationsController
Overview
The controller to handle the user’s notifications dashboard.
Constant Summary
Constants included
from Paginable
Paginable::OPTIONS
Instance Method Summary
collapse
enhance_controller, extended, included
Instance Method Details
#destroy ⇒ Object
17
18
19
20
21
|
# File 'app/controllers/decidim/notifications_controller.rb', line 17
def destroy
notification = notifications.find(params[:id])
authorize! :destroy, notification
notification.destroy
end
|
#index ⇒ Object
12
13
14
15
|
# File 'app/controllers/decidim/notifications_controller.rb', line 12
def index
authorize! :read, Notification
@notifications = paginate(notifications)
end
|
#read_all ⇒ Object
23
24
25
26
|
# File 'app/controllers/decidim/notifications_controller.rb', line 23
def read_all
authorize! :destroy, notifications.first
notifications.destroy_all
end
|