summaryrefslogtreecommitdiff
path: root/app/controllers/tournaments_controller.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-03 17:17:12 -0400
committertkimia <tkimia@purdue.edu>2014-04-03 17:17:12 -0400
commit051e61877b4c77a17fd4fa68dfca4d5e74a687df (patch)
tree50830d69ff08b5cd636955b785b4bcc840ae82f5 /app/controllers/tournaments_controller.rb
parent25cfa69883a5c74b2a6e6a5021c53fd95202c234 (diff)
fixed some of andrews weird stuff with starting a tournament
Diffstat (limited to 'app/controllers/tournaments_controller.rb')
-rw-r--r--app/controllers/tournaments_controller.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 9cf3404..4bba997 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -36,12 +36,7 @@ class TournamentsController < ApplicationController
# GET /tournaments/1/edit
def edit
- if params['close_action'] == 'close'
- @tournament.status = 1
- @tournament.save
- @tournament.setup(@tournament)
- redirect_to "/tournaments"
- end
+
end
# POST /tournaments
@@ -96,7 +91,10 @@ class TournamentsController < ApplicationController
format.html {redirect_to @tournament, notice: 'You were\'t a part of this tournament.' }
format.json { render json: "Permission denied", status: :forbidden }
end
- when "open"
+ 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.' }
@@ -105,8 +103,6 @@ class TournamentsController < ApplicationController
format.html { render action: 'permission_denied', status: :forbidden }
format.json { render json: "Permission denied", status: :forbidden }
end
- #when "close"
- # TODO
else
respond_to do |format|
format.html { render action: 'show', notice: "Invalid action", status: :unprocessable_entity }