mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
24 lines
557 B
Ruby
24 lines
557 B
Ruby
|
|
# frozen_string_literal: true
|
||
|
|
|
||
|
|
class NotificationsController < ApplicationController
|
||
|
|
before_action :authenticate_user!
|
||
|
|
before_action :set_notification, only: %i[show destroy]
|
||
|
|
|
||
|
|
def index
|
||
|
|
@notifications = current_user.notifications.paginate(page: params[:page], per_page: 25)
|
||
|
|
end
|
||
|
|
|
||
|
|
def show; end
|
||
|
|
|
||
|
|
def destroy
|
||
|
|
@notification.destroy!
|
||
|
|
redirect_to notifications_url, notice: 'Notification was successfully destroyed.', status: :see_other
|
||
|
|
end
|
||
|
|
|
||
|
|
private
|
||
|
|
|
||
|
|
def set_notification
|
||
|
|
@notification = Notification.find(params[:id])
|
||
|
|
end
|
||
|
|
end
|