1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +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

@@ -19,13 +19,13 @@ class MatchesController < ApplicationController
# GET /matches/1/edit
def edit
if user_signed_in?
else
redirect_to root_path
end
if params[:match]
@match = Match.find (params[:match])
end
if current_user == @match.tournament.user
else
redirect_to root_path
end
if @match
@w1 = Wrestler.find(@match.w1)
@w2 = Wrestler.find(@match.w2)
@@ -55,7 +55,7 @@ class MatchesController < ApplicationController
# PATCH/PUT /matches/1
# PATCH/PUT /matches/1.json
def update
if user_signed_in?
if current_user == @match.tournament.user
else
redirect_to root_path
end