From 898caee2a65dd6819aee33f3d09084023691ef86 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Tue, 7 Jan 2014 13:17:40 -0500 Subject: [PATCH] Trying to get create wrestler for school link to work --- app/views/schools/show.html.erb | 3 +++ app/views/wrestlers/_form.html.erb | 11 +++++++---- config/routes.rb | 8 ++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb index dcdd7ee..2386ccf 100644 --- a/app/views/schools/show.html.erb +++ b/app/views/schools/show.html.erb @@ -16,6 +16,9 @@ +
+
+<%= link_to "New #{@school.name} Wrestler" , new_wrestler_path(@school) %>

diff --git a/app/views/wrestlers/_form.html.erb b/app/views/wrestlers/_form.html.erb index c1bb33d..f1e2893 100644 --- a/app/views/wrestlers/_form.html.erb +++ b/app/views/wrestlers/_form.html.erb @@ -15,10 +15,13 @@ <%= f.label :name %>
<%= f.text_field :name %> -
- <%= f.label 'School' %>
- <%= f.collection_select :school_id, School.all, :id, :name %> -
+ + +
+ <%= f.label 'School' %>
+ <%= f.collection_select :school_id, School.all, :id, :name %> +
+
<%= f.label 'Weight Class' %>
<%= f.collection_select :weight_id, Weight.all, :id, :max %> diff --git a/config/routes.rb b/config/routes.rb index f48894b..69300d3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,13 @@ Wrestling::Application.routes.draw do - resources :wrestlers + resources :schools resources :weights - resources :schools + resources :wrestlers + + + + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes".