mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Can edit wrestler school
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
<%= f.text_field :name %>
|
||||
</div>
|
||||
|
||||
<% if @school %>
|
||||
<% if @tournament %>
|
||||
<%= f.hidden_field :school_id, :value => @school.id %>
|
||||
<% else %>
|
||||
<div class="field">
|
||||
<%= f.label 'School' %><br>
|
||||
<%= f.collection_select :school_id, @tournament.schools, :id, :name %>
|
||||
<%= f.collection_select :school_id, @school.tournament.schools, :id, :name %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="field">
|
||||
|
||||
Reference in New Issue
Block a user