diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-03-06 22:31:03 -0500 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-03-06 22:31:03 -0500 |
commit | ce8b05ed8fa3466c727269daa47ba7df672fdca1 (patch) | |
tree | e89c40080858aa63ba2837b697ef0eafe06cb4bf /app/controllers | |
parent | 3f6f212c1d50a0ae953104524ceffe94095307cf (diff) |
Redirection works as does the close tournament button.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/tournaments_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 3f6de26..9e6a6e6 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -11,8 +11,10 @@ class TournamentsController < ApplicationController # GET /tournaments/1 # GET /tournaments/1.json def show - unless @tournament.status - redirect_to tournament_matches_page(@tournament) + case @tournament.status + when 0 + when 1..2 + redirect_to "/tournaments/" + @tournament.id.to_s + "/matches" #tournament_matches_page(@tournament) end end @@ -25,6 +27,11 @@ class TournamentsController < ApplicationController # GET /tournaments/1/edit def edit + if params['close_action'] == 'close' + @tournament.status = 1 + @tournament.save + redirect_to "/tournaments" + end end # POST /tournaments |