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

Fixed bug on wrestler form to allow a tournament director to move a wrestler to another school

This commit is contained in:
2017-01-18 13:53:17 +00:00
parent b7775172a3
commit d7c82a8d71
2 changed files with 3 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ class WrestlersController < ApplicationController
def edit
@weight = @wrestler.weight
@weights = @school.tournament.weights.sort_by{|w| w.max}
@school = @wrestler.school
end
# POST /wrestlers

View File

@@ -17,14 +17,12 @@
<%= f.text_field :name %>
</div>
<% if can? :manage, @wrestler.tournament %>
<% if @tournament %>
<%= f.hidden_field :school_id, :value => @school.id %>
<% else %>
<div class="field">
<%= f.label 'School' %><br>
<%= f.collection_select :school_id, @school.tournament.schools, :id, :name %>
</div>
<% end %>
<% else %>
<%= f.hidden_field :school_id, :value => @school.id %>
<% end %>
<div class="field">
<%= f.label 'Weight Class' %><br>