Hi -- I have a routes.rb file with the following in it:
<CODE>
map.resource :admin do |admin|
admin.resources :users
admin.resources :clients do |client|
client.resources :client_properties
end
admin.resources :areas
admin.resources :properties
end
</CODE>
My problem is when I try to access the show or edit actions of the
client_properties resource.
The function client_property_path( client, property ) returns the
correct url -- "/clients/1/client_properties/2" -- but the routing
then
fails on this with the following error:
<ERROR>
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1273:in
`raise_named_route_error'': client_property_url failed to generate from
{:client_id=>"2", :controller=>"client_properties",
:action=>"show"},
expected: {:controller=>"client_properties",
:action=>"show"}, diff:
{:client_id=>"2"}
</ERROR>
(NOTE -- it seems to taking the property id as the client id.)
By my understanding there should be no cause for an error here.
Can anyone shed any light on what I''m getting wrong?
Or if maybe my understanding of how resources & nesting works is in
error, could they point that out?
& thanks in advance for any & all assistance,
Doug.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---