1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-24 17:04:43 +00:00

Fixed wrestler show and edit

This commit is contained in:
Jacob Cody Wimer
2014-01-22 22:50:47 -05:00
parent 6058ceb9f2
commit c551852dfb
2 changed files with 6 additions and 2 deletions

View File

@@ -5,12 +5,13 @@ class WrestlersController < ApplicationController
# GET /wrestlers.json
def index
@wrestlers = Wrestler.all
#@school = School.find(@wrestler.school_id)
@school = School.find(@wrestler.school_id)
end
# GET /wrestlers/1
# GET /wrestlers/1.json
def show
@school = School.find(@wrestler.school_id)
end
# GET /wrestlers/new
@@ -34,6 +35,9 @@ class WrestlersController < ApplicationController
# GET /wrestlers/1/edit
def edit
@school_field = @wrestler.school_id
@school = School.find(@wrestler.school_id)
@tournament = Tournament.find(@school.tournament_id)
@weight = Weight.where(tournament_id: @tournament.id)
end
# POST /wrestlers

View File

@@ -24,10 +24,10 @@
<%= f.collection_select :school_id, School.all, :id, :name %>
</div>
<% end %>
<div class="field">
<%= f.label 'Weight Class' %><br>
<%= f.collection_select :weight_id, @weight, :id, :max %>
</div>
<div class="field">
<%= f.label :original_seed %><br>