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:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user