Displaying 1 result from an estimated 1 matches for "user_laboratory".
2008 Feb 28
2
REST nested routes with has_one
...s_to :pi, :class_name => "User", :foreign_key => "pi_id"
end
I set the following routes (in routes.rb):
map.resources :laboratories
map.resources :users, :has_one => :laboratory
All the routes are generated as expected, as demonstrated by rake
routes. In particular:
user_laboratory GET /users/:user_id/laboratory
{:controller=>"laboratories", :action=>"show"}
But if I try users/17/laboratory, I get a ''Couldn''t find Laboratory
without an ID'' error. Someone could help me with this?
In advance thank you very much.
Yannis
--
P...