1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-09 07:39:06 +00:00

Cleaned school controller

This commit is contained in:
2015-10-28 13:45:11 -04:00
parent a77678c593
commit 208b716e56

View File

@@ -6,8 +6,8 @@ class SchoolsController < ApplicationController
# GET /schools/1 # GET /schools/1
# GET /schools/1.json # GET /schools/1.json
def show def show
@wrestlers = Wrestler.where(school_id: @school.id) @wrestlers = @school.wrestlers
@tournament = Tournament.find(@school.tournament_id) @tournament = @school.tournament
end end
# GET /schools/new # GET /schools/new
@@ -44,7 +44,7 @@ class SchoolsController < ApplicationController
# PATCH/PUT /schools/1 # PATCH/PUT /schools/1
# PATCH/PUT /schools/1.json # PATCH/PUT /schools/1.json
def update def update
@tournament = Tournament.find(@school.tournament_id) @tournament = @school.tournament
respond_to do |format| respond_to do |format|
if @school.update(school_params) if @school.update(school_params)
format.html { redirect_to @tournament, notice: 'School was successfully updated.' } format.html { redirect_to @tournament, notice: 'School was successfully updated.' }
@@ -59,7 +59,7 @@ class SchoolsController < ApplicationController
# DELETE /schools/1 # DELETE /schools/1
# DELETE /schools/1.json # DELETE /schools/1.json
def destroy def destroy
@tournament = Tournament.find(@school.tournament_id) @tournament = @school.tournament
@school.destroy @school.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to @tournament } format.html { redirect_to @tournament }