summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 22:34:15 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 22:34:15 -0500
commite1f6378a2c197a6d1c64f365dd52d2961e104cdb (patch)
treea70c07c7daaa400eb256cafe96faba73a2dce450 /app/controllers
parent70bae69d731afc5300ffa5b176732ebe27d0810f (diff)
tidy up the tournament join and open controller logic
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/tournaments_controller.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 1e26584..386a6a4 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -65,18 +65,20 @@ class TournamentsController < ApplicationController
if @tournament.join(current_user)
format.html { render action: 'show', notice: 'You have joined this tournament.' }
format.json { head :no_content }
+ else
+ format.html { render action: 'permission_denied', status: :forbidden }
+ format.json { render json: "Permission denied", status: :forbidden }
end
- format.html { render action: 'permission_denied', status: :forbidden }
- format.json { render json: "Permission denied", status: :forbidden }
end
when "open"
respond_to do |format|
if @tournament.setup
- format.html { render action: 'show', notice: 'You have joined this tournament.' }
+ format.html { render action: 'show', notice: 'You have opend this tournament.' }
format.json { head :no_content }
+ else
+ format.html { render action: 'permission_denied', status: :forbidden }
+ format.json { render json: "Permission denied", status: :forbidden }
end
- format.html { render action: 'permission_denied', status: :forbidden }
- format.json { render json: "Permission denied", status: :forbidden }
end
#when "close"
# TODO