1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 22:44:14 +00:00

First crack at setting an owner for the tournament

This commit is contained in:
2015-10-23 08:53:29 -04:00
parent f204024b23
commit ad9ea9dc42
14 changed files with 76 additions and 72 deletions

View File

@@ -68,12 +68,11 @@ class StaticPagesController < ApplicationController
end
def createCustomWeights
if user_signed_in?
else
redirect_to root_path
end
@tournament = Tournament.find(params[:tournament])
@custom = params[:customValue].to_s
if current_user != @tournament.user
redirect_to root_path
end
@custom = params[:customValue].to_s
@tournament.createCustomWeights(@custom)
redirect_to "/tournaments/#{@tournament.id}"
@@ -92,6 +91,9 @@ class StaticPagesController < ApplicationController
elsif user_signed_in?
if params[:tournament]
@tournament = Tournament.find(params[:tournament])
if current_user != @tournament.user
redirect_to root_path
end
end
if @tournament
@tournament.generateMatchups
@@ -108,6 +110,9 @@ class StaticPagesController < ApplicationController
end
if params[:tournament]
@tournament = Tournament.find(params[:tournament])
if current_user != @tournament.user
redirect_to root_path
end
@tournament_id = @tournament.id
@tournament_name = @tournament.name
end