mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-07 14:57:48 +00:00
Fixed indentations
This commit is contained in:
@@ -63,13 +63,13 @@ class WeightsController < ApplicationController
|
|||||||
# DELETE /weights/1.json
|
# DELETE /weights/1.json
|
||||||
def destroy
|
def destroy
|
||||||
@tournament = Tournament.find(@weight.tournament_id)
|
@tournament = Tournament.find(@weight.tournament_id)
|
||||||
if current_user != @tournament.user
|
if current_user != @tournament.user
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
@weight.destroy
|
@weight.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to @tournament }
|
format.html { redirect_to @tournament }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -83,18 +83,18 @@ class WeightsController < ApplicationController
|
|||||||
def weight_params
|
def weight_params
|
||||||
params.require(:weight).permit(:max, :tournament_id, :mat_id)
|
params.require(:weight).permit(:max, :tournament_id, :mat_id)
|
||||||
end
|
end
|
||||||
def check_access
|
def check_access
|
||||||
if params[:tournament]
|
if params[:tournament]
|
||||||
@tournament = Tournament.find(params[:tournament])
|
@tournament = Tournament.find(params[:tournament])
|
||||||
elsif params[:weight]
|
elsif params[:weight]
|
||||||
@tournament = Tournament.find(params[:weight]["tournament_id"])
|
@tournament = Tournament.find(params[:weight]["tournament_id"])
|
||||||
elsif @weight
|
elsif @weight
|
||||||
@tournament = @weight.tournament
|
@tournament = @weight.tournament
|
||||||
end
|
end
|
||||||
if current_user != @tournament.user
|
if current_user != @tournament.user
|
||||||
redirect_to '/static_pages/not_allowed'
|
redirect_to '/static_pages/not_allowed'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user