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:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user