1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-15 01:17:12 +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

@@ -46,10 +46,9 @@ class TournamentsController < ApplicationController
# PATCH/PUT /tournaments/1
# PATCH/PUT /tournaments/1.json
def update
if user_signed_in?
else
redirect_to root_path
end
if current_user != @tournament.user
redirect_to root_path
end
respond_to do |format|
if @tournament.update(tournament_params)
format.html { redirect_to @tournament, notice: 'Tournament was successfully updated.' }
@@ -64,10 +63,9 @@ class TournamentsController < ApplicationController
# DELETE /tournaments/1
# DELETE /tournaments/1.json
def destroy
if user_signed_in?
else
redirect_to root_path
end
if current_user != @tournament.user
redirect_to root_path
end
@tournament.destroy
respond_to do |format|
format.html { redirect_to tournaments_url }