notebook/app/controllers/notice_dismissal_controller.rb
2019-05-30 15:26:36 -05:00

9 lines
312 B
Ruby

class NoticeDismissalController < ApplicationController
before_action :authenticate_user!
def dismiss
current_user.notice_dismissals.find_or_create_by(notice_id: params[:notice_id].to_i)
redirect_back(fallback_location: dashboard_path, notice: "Notice dismissed! You won't see it again.")
end
end