mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-05 22:21:26 +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
|
def edit
|
||||||
@weight = @wrestler.weight
|
@weight = @wrestler.weight
|
||||||
@weights = @school.tournament.weights.sort_by{|w| w.max}
|
@weights = @school.tournament.weights.sort_by{|w| w.max}
|
||||||
|
@school = @wrestler.school
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /wrestlers
|
# POST /wrestlers
|
||||||
|
|||||||
@@ -17,14 +17,12 @@
|
|||||||
<%= f.text_field :name %>
|
<%= f.text_field :name %>
|
||||||
</div>
|
</div>
|
||||||
<% if can? :manage, @wrestler.tournament %>
|
<% if can? :manage, @wrestler.tournament %>
|
||||||
<% if @tournament %>
|
|
||||||
<%= f.hidden_field :school_id, :value => @school.id %>
|
|
||||||
<% else %>
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label 'School' %><br>
|
<%= f.label 'School' %><br>
|
||||||
<%= f.collection_select :school_id, @school.tournament.schools, :id, :name %>
|
<%= f.collection_select :school_id, @school.tournament.schools, :id, :name %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% else %>
|
||||||
|
<%= f.hidden_field :school_id, :value => @school.id %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label 'Weight Class' %><br>
|
<%= f.label 'Weight Class' %><br>
|
||||||
|
|||||||
Reference in New Issue
Block a user