diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-03-06 18:36:14 -0500 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-03-06 18:36:14 -0500 |
commit | 1ec0bbad344790e7181a586cd24914c677d20d32 (patch) | |
tree | f9b6604ea611543041fb70ab50f8f432cd4e788f /app/controllers | |
parent | 0c1299795a492e6296eb8e15bca576ea5139be6b (diff) |
Here's Luke's stuff because he doesn't have wifi.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/tournaments_controller.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index cf618aa..4f79d44 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -15,9 +15,8 @@ class TournamentsController < ApplicationController # GET /tournaments/new def new - @game_names = Game.all.collect - @game = params[:game] - @tournament = Tournament.new + @games = Game.all + @tournament = Tournament.new(game: Game.find_by_id(params[:game])) end # GET /tournaments/1/edit @@ -70,14 +69,14 @@ class TournamentsController < ApplicationController @tournament = Tournament.find(params[:id]) end - def check_perms - unless (signed_in? and current_user.in_group?(:host)) - respond_to do |format| - format.html { render action: 'permission_denied', status: :forbidden } - format.json { render json: "Permission denied", status: :forbidden } - end - end - end + def check_perms + unless (signed_in? and current_user.in_group?(:host)) + respond_to do |format| + format.html { render action: 'permission_denied', status: :forbidden } + format.json { render json: "Permission denied", status: :forbidden } + end + end + end # Never trust parameters from the scary internet, only allow the white list through. def tournament_params |