summaryrefslogtreecommitdiff
path: root/app/controllers/tournaments_controller.rb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-17 18:41:18 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-17 18:41:18 -0400
commit51cec17b7e4aa6291c3fb19bd74cc4dee42eba60 (patch)
treec9dacc0eb9518f64629d58f1c4f5688a0604b5d5 /app/controllers/tournaments_controller.rb
parenteab572fdecdaf3cf7464d189f0b1de1d1c3b2c46 (diff)
redirection
Diffstat (limited to 'app/controllers/tournaments_controller.rb')
-rw-r--r--app/controllers/tournaments_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index f572248..bb1d222 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -127,6 +127,11 @@ class TournamentsController < ApplicationController
private
# Use callbacks to share common setup or constraints between actions.
def set_tournament
+ if @tournament.nil?
+ respond_to do |format|
+ format.html { redirect_to @tournament, notice: 'That tournament no longer exists.' }
+ end
+ end
@tournament = Tournament.find(params[:id])
end