1
0
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:
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
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

View File

@@ -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">