diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-20 16:03:24 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-20 16:03:24 -0400 |
commit | 641b619ae503ea70ea36c75d658f133775379deb (patch) | |
tree | 7e663e3a6aa9c8548413737da20c82f87a8459f7 /app/controllers | |
parent | 49f579f025235045840e17005fd84edc9e12f9eb (diff) | |
parent | 16750bab527d574867a64e3092f7335a028195cb (diff) |
Merge branch 'master' of github.com:LukeShu/leaguer
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/tournaments_controller.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index bb1d222..57e73aa 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -127,12 +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 + begin + @tournament = Tournament.find(params[:id]) + rescue + redirect_to tournaments_url, notice: 'That tournament no longer exists.' end - @tournament = Tournament.find(params[:id]) end # Never trust parameters from the scary internet, only allow the white list through. @@ -148,4 +147,5 @@ class TournamentsController < ApplicationController def check_edit set_tournament end + end |