diff --git a/app/controllers/wrestlers_controller.rb b/app/controllers/wrestlers_controller.rb
index fce7f89..1933d40 100644
--- a/app/controllers/wrestlers_controller.rb
+++ b/app/controllers/wrestlers_controller.rb
@@ -15,6 +15,9 @@ class WrestlersController < ApplicationController
# GET /wrestlers/new
def new
@wrestler = Wrestler.new
+ if params[:school]
+ @school = params[:school]
+ end
end
# GET /wrestlers/1/edit
diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb
index 2386ccf..6f396d8 100644
--- a/app/views/schools/show.html.erb
+++ b/app/views/schools/show.html.erb
@@ -18,7 +18,7 @@
-<%= link_to "New #{@school.name} Wrestler" , new_wrestler_path(@school) %>
+<%= link_to "New #{@school.name} Wrestler" , "/wrestlers/new?school=#{@school.id}" %>
diff --git a/app/views/wrestlers/_form.html.erb b/app/views/wrestlers/_form.html.erb
index f1e2893..7003c67 100644
--- a/app/views/wrestlers/_form.html.erb
+++ b/app/views/wrestlers/_form.html.erb
@@ -15,12 +15,15 @@
<%= f.label :name %>
<%= f.text_field :name %>
-
+ <% if @school %>
+ <%= f.hidden_field :school_id, :value => @school %>
+ <% else %>