mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-05-12 16:59:00 +00:00
Fixed validation bug
This commit is contained in:
@@ -53,6 +53,9 @@ class WrestlersController < ApplicationController
|
||||
# PATCH/PUT /wrestlers/1
|
||||
# PATCH/PUT /wrestlers/1.json
|
||||
def update
|
||||
@tournament = @wrestler.tournament
|
||||
@weight = @wrestler.weight
|
||||
@weights = @tournament.weights.sort_by{|w| w.max}
|
||||
@school = @wrestler.school
|
||||
respond_to do |format|
|
||||
if @wrestler.update(wrestler_params)
|
||||
@@ -79,7 +82,7 @@ class WrestlersController < ApplicationController
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_wrestler
|
||||
@wrestler = Wrestler.where(:id => params[:id]).includes(:tournament,:school,:weight,:matches).first
|
||||
@wrestler = Wrestler.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
|
||||
Reference in New Issue
Block a user