Add notices
This commit is contained in:
@@ -40,7 +40,7 @@ class ContestsController < ApplicationController
|
||||
@contest = Contest.new(contest_params)
|
||||
@contest.user_id = current_user.id
|
||||
if @contest.save
|
||||
redirect_to @contest
|
||||
redirect_to @contest, notice: t("contests.new.notice")
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
@@ -50,7 +50,7 @@ class ContestsController < ApplicationController
|
||||
authorize @contest
|
||||
|
||||
if @contest.update(contest_params)
|
||||
redirect_to @contest
|
||||
redirect_to @contest, notice: t("contests.edit.notice")
|
||||
else
|
||||
@action_name = t("helpers.buttons.back")
|
||||
@action_path = contest_path(@contest)
|
||||
@@ -60,6 +60,9 @@ class ContestsController < ApplicationController
|
||||
|
||||
def destroy
|
||||
authorize @contest
|
||||
|
||||
@contest.destroy
|
||||
redirect_to contests_path, notice: t("contests.destroy.notice")
|
||||
end
|
||||
|
||||
def scoreboard
|
||||
|
||||
Reference in New Issue
Block a user