diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-01 17:18:13 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-01 17:18:13 -0400 |
commit | ac77cea14d5708f47df42774b0b281391b2e3c89 (patch) | |
tree | cf66f26702c9648687438de1d4f09306ca453c20 /app/controllers | |
parent | 031b31dfcc2b99836021d6e251c78a9fc339d444 (diff) | |
parent | 0867bc68749873aa131c0f3b273771b5f70ae778 (diff) |
Merge branch 'master' of http://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/static_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/tournaments_controller.rb | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 6fc9490..038cc19 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -1,4 +1,7 @@ class StaticController < ApplicationController def homepage end + + def test + end end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 027aad6..165ad87 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -76,7 +76,16 @@ class TournamentsController < ApplicationController end format.html { render action: 'permission_denied', status: :forbidden } format.json { render json: "Permission denied", status: :forbidden } - end + end + when "leave" + respond_to do |format| + if @tournament.leave(current_user) + 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.' } + format.json { render json: "Permission denied", status: :forbidden } + end when "open" respond_to do |format| if @tournament.setup |