1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-16 21:11:38 +00:00

Can edit wrestler school

This commit is contained in:
2016-01-22 14:12:56 +00:00
parent e48d473807
commit 2b1b9270fd
2 changed files with 3 additions and 5 deletions

View File

@@ -27,10 +27,8 @@ class WrestlersController < ApplicationController
# GET /wrestlers/1/edit # GET /wrestlers/1/edit
def edit def edit
@school = @wrestler.school
@tournament = @wrestler.tournament
@weight = @wrestler.weight @weight = @wrestler.weight
@weights = @tournament.weights.sort_by{|w| w.max} @weights = @school.tournament.weights.sort_by{|w| w.max}
end end
# POST /wrestlers # POST /wrestlers

View File

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