Class: Notifications::NotificationsController
Instance Method Summary
collapse
#authenticate_user!, #current_user
Instance Method Details
#clean ⇒ Object
12
13
14
15
|
# File 'app/controllers/notifications/notifications_controller.rb', line 12
def clean
notifications.delete_all
redirect_to notifications_path
end
|
#index ⇒ Object
3
4
5
6
7
8
9
10
|
# File 'app/controllers/notifications/notifications_controller.rb', line 3
def index
@notifications = notifications.includes(:actor).order('id desc').page(params[:page])
unread_ids = @notifications.reject(&:read?).select(&:id)
Notification.read!(unread_ids)
@notification_groups = @notifications.group_by { |note| note.created_at.to_date }
end
|