1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-04 13:43:48 +00:00

A ton of stuff was done to finalize the app for use

This commit is contained in:
Jacob Cody Wimer
2014-01-25 05:28:42 -05:00
parent 7f8718af35
commit c5a7bc3815
45 changed files with 889 additions and 22 deletions

View File

@@ -31,6 +31,10 @@ class SchoolsController < ApplicationController
# POST /schools
# POST /schools.json
def create
if user_signed_in?
else
redirect_to root_path
end
@school = School.new(school_params)
@tournament = Tournament.find(school_params[:tournament_id])
respond_to do |format|
@@ -47,6 +51,10 @@ class SchoolsController < ApplicationController
# PATCH/PUT /schools/1
# PATCH/PUT /schools/1.json
def update
if user_signed_in?
else
redirect_to root_path
end
@tournament = Tournament.find(@school.tournament_id)
respond_to do |format|
if @school.update(school_params)
@@ -62,6 +70,10 @@ class SchoolsController < ApplicationController
# DELETE /schools/1
# DELETE /schools/1.json
def destroy
if user_signed_in?
else
redirect_to root_path
end
@tournament = Tournament.find(@school.tournament_id)
@school.destroy
respond_to do |format|