I made 1 to many relation ships with school and professor....search option
is working for professor but not for school. here are the erorrs and my
code...please help---

ActiveRecord::RecordNotFound in ProfessorsController#index

Couldn't find School without an ID

Rails.root: /home/vmuser/workspace/project3 -3
Application Trace<http://localhost:3000/professors?utf8=%E2%9C%93&search=taylor#>| Framework
Trace <http://localhost:3000/professors?utf8=%E2%9C%93&search=taylor#> | Full
Trace <http://localhost:3000/professors?utf8=%E2%9C%93&search=taylor#>

app/controllers/professors_controller.rb:15:in `index'



codes in controller:
def index

@school=School.find(params[:id])
@professor =@school.professors.build
@professors =Professor.search(params[:search])
end

codes in index:
<%= form_tag professors_path, :method => :get do %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
<% end %>


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/5TBmnCOs_jsJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 23, '12 at 2:01a
activeMay 23, '12 at 2:01a
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Roy: 1 post

People

Translate

site design / logo © 2022 Grokbase