summaryrefslogtreecommitdiff
path: root/app/controllers/tournaments_controller.rb
diff options
context:
space:
mode:
authorTomer Kimia <tkimia@purdue.edu>2014-03-06 22:06:32 -0500
committerTomer Kimia <tkimia@purdue.edu>2014-03-06 22:06:32 -0500
commit2bfc17c39f9b8b5ea71d36d2d5f041295f24192f (patch)
treedb8a9a72364e7fc80c17a0c3c2c58b835d06f140 /app/controllers/tournaments_controller.rb
parent3f6f212c1d50a0ae953104524ceffe94095307cf (diff)
tournaments setup started. NOT FINISHED
Diffstat (limited to 'app/controllers/tournaments_controller.rb')
-rw-r--r--app/controllers/tournaments_controller.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 3f6de26..750a4e7 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -46,8 +46,7 @@ class TournamentsController < ApplicationController
# PATCH/PUT /tournaments/1
# PATCH/PUT /tournaments/1.json
def update
- require 'pp'
- pp params
+
if params[:update_action].nil?
check_perms
respond_to do |format|
@@ -70,8 +69,15 @@ class TournamentsController < ApplicationController
format.html { render action: 'permission_denied', status: :forbidden }
format.json { render json: "Permission denied", status: :forbidden }
end
- #when "open"
- # TODO
+ when "open"
+ respond_to do |format|
+ if @tournament.setup
+ format.html { render action: 'show', notice: 'You have joined this tournament.' }
+ format.json { head :no_content }
+ end
+ format.html { render action: 'permission_denied', status: :forbidden }
+ format.json { render json: "Permission denied", status: :forbidden }
+ end
#when "close"
# TODO
else