1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Auto creating of high school weights

This commit is contained in:
2015-04-27 14:58:22 -04:00
parent 19bd2ac8f8
commit e7bfad8df0
6 changed files with 47 additions and 13 deletions

View File

@@ -42,15 +42,16 @@ class WeightsController < ApplicationController
end
@weight = Weight.new(weight_params)
@tournament = Tournament.find(weight_params[:tournament_id])
respond_to do |format|
if @weight.save
format.html { redirect_to @tournament, notice: 'Weight was successfully created.' }
format.json { render action: 'show', status: :created, location: @weight }
else
format.html { render action: 'new' }
format.json { render json: @weight.errors, status: :unprocessable_entity }
respond_to do |format|
if @weight.save
format.html { redirect_to @tournament, notice: 'Weight was successfully created.' }
format.json { render action: 'show', status: :created, location: @weight }
else
format.html { render action: 'new' }
format.json { render json: @weight.errors, status: :unprocessable_entity }
end
end
end
end
# PATCH/PUT /weights/1