Improve redirections after puzzles/messages controllers
This commit is contained in:
@@ -91,7 +91,7 @@ class MessagesController < ApplicationController
|
|||||||
|
|
||||||
@message = Message.find(params[:id])
|
@message = Message.find(params[:id])
|
||||||
@message.destroy
|
@message.destroy
|
||||||
redirect_to contest_path(@contest), notice: t("messages.destroy.notice")
|
redirect_to contest_messages_path(@contest), notice: t("messages.destroy.notice")
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class PuzzlesController < ApplicationController
|
|||||||
@puzzle = Puzzle.new(puzzle_params)
|
@puzzle = Puzzle.new(puzzle_params)
|
||||||
@puzzle.contest_id = @contest.id
|
@puzzle.contest_id = @contest.id
|
||||||
if @puzzle.save
|
if @puzzle.save
|
||||||
redirect_to contest_path(@contest), notice: t("puzzles.new.notice")
|
redirect_to contest_puzzles_path(@contest), notice: t("puzzles.new.notice")
|
||||||
else
|
else
|
||||||
render :new, status: :unprocessable_entity
|
render :new, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
@@ -35,7 +35,7 @@ class PuzzlesController < ApplicationController
|
|||||||
authorize @contest
|
authorize @contest
|
||||||
|
|
||||||
if @puzzle.update(puzzle_params)
|
if @puzzle.update(puzzle_params)
|
||||||
redirect_to @contest, notice: t("puzzles.edit.notice")
|
redirect_to contest_puzzles_path(@contest), notice: t("puzzles.edit.notice")
|
||||||
else
|
else
|
||||||
render :edit, status: :unprocessable_entity
|
render :edit, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
@@ -45,7 +45,7 @@ class PuzzlesController < ApplicationController
|
|||||||
authorize @contest
|
authorize @contest
|
||||||
|
|
||||||
@puzzle.destroy
|
@puzzle.destroy
|
||||||
redirect_to contest_path(@contest), notice: t("puzzles.destroy.notice")
|
redirect_to contest_puzzles_path(@contest), notice: t("puzzles.destroy.notice")
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user