Files
nairobi/app/controllers/notifications_controller.rb
2016-01-05 17:43:44 +01:00

11 lines
301 B
Ruby

class NotificationsController < ApplicationController
before_action :authenticate_user!
load_and_authorize_resource class: "User"
def index
@notifications = current_user.notifications.unread.recent.for_render
@notifications.each { |notification| notification.mark_as_read! }
end
end