diff --git a/app/controllers/wrestlers_controller.rb b/app/controllers/wrestlers_controller.rb index ae055f5..afc2f09 100644 --- a/app/controllers/wrestlers_controller.rb +++ b/app/controllers/wrestlers_controller.rb @@ -27,10 +27,8 @@ class WrestlersController < ApplicationController # GET /wrestlers/1/edit def edit - @school = @wrestler.school - @tournament = @wrestler.tournament @weight = @wrestler.weight - @weights = @tournament.weights.sort_by{|w| w.max} + @weights = @school.tournament.weights.sort_by{|w| w.max} end # POST /wrestlers diff --git a/app/views/wrestlers/_form.html.erb b/app/views/wrestlers/_form.html.erb index 2c09d96..fa083e4 100644 --- a/app/views/wrestlers/_form.html.erb +++ b/app/views/wrestlers/_form.html.erb @@ -17,12 +17,12 @@ <%= f.text_field :name %> - <% if @school %> + <% if @tournament %> <%= f.hidden_field :school_id, :value => @school.id %> <% else %>