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

@@ -43,6 +43,10 @@ class WrestlersController < ApplicationController
# POST /wrestlers
# POST /wrestlers.json
def create
if user_signed_in?
else
redirect_to root_path
end
@wrestler = Wrestler.new(wrestler_params)
@school = School.find(wrestler_params[:school_id])
respond_to do |format|
@@ -59,6 +63,10 @@ class WrestlersController < ApplicationController
# PATCH/PUT /wrestlers/1
# PATCH/PUT /wrestlers/1.json
def update
if user_signed_in?
else
redirect_to root_path
end
@school = School.find(@wrestler.school_id)
respond_to do |format|
if @wrestler.update(wrestler_params)
@@ -74,6 +82,10 @@ class WrestlersController < ApplicationController
# DELETE /wrestlers/1
# DELETE /wrestlers/1.json
def destroy
if user_signed_in?
else
redirect_to root_path
end
@school = School.find(@wrestler.school_id)
@wrestler.destroy
respond_to do |format|