diff options
author | tkimia <tkimia@purdue.edu> | 2014-04-03 18:03:25 -0400 |
---|---|---|
committer | tkimia <tkimia@purdue.edu> | 2014-04-03 18:03:25 -0400 |
commit | effe4608e808a385bb912fccac26381d0bd0c95a (patch) | |
tree | 68f45ec586be9a80c4d3cd74938db65c0d73a9f1 /app/controllers | |
parent | 0c1583c0b31504dfdbbbec3e6dcc240acb059891 (diff) |
matches table is back, and a lot of things are fixed
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/tournaments_controller.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 4bba997..ae384c1 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -76,7 +76,7 @@ class TournamentsController < ApplicationController when "join" respond_to do |format| if @tournament.join(current_user) - format.html { render action: 'show', notice: 'You have joined this tournament.' } + format.html { redirect_to @tournament, notice: 'You have joined this tournament.' } format.json { head :no_content } end format.html { render action: 'permission_denied', status: :forbidden } @@ -85,7 +85,7 @@ class TournamentsController < ApplicationController when "leave" respond_to do |format| if @tournament.leave(current_user) - format.html {redirect_to tournaments_url, notice: 'You have left the tournament.' } + format.html { redirect_to tournaments_url, notice: 'You have left the tournament.' } format.json { head :no_content } end format.html {redirect_to @tournament, notice: 'You were\'t a part of this tournament.' } @@ -94,10 +94,9 @@ class TournamentsController < ApplicationController when "start" @tournament.status = 1 @tournament.save - @tournament.setup() respond_to do |format| if @tournament.setup - format.html { render action: 'show', notice: 'You have joined this tournament.' } + format.html { redirect_to @tournament, notice: 'You have joined this tournament.' } format.json { head :no_content } end format.html { render action: 'permission_denied', status: :forbidden } @@ -105,7 +104,7 @@ class TournamentsController < ApplicationController end else respond_to do |format| - format.html { render action: 'show', notice: "Invalid action", status: :unprocessable_entity } + format.html { redirect_to @tournament, notice: "Invalid action", status: :unprocessable_entity } format.json { render json: @tournament.errors, status: :unprocessable_entity } end end |