RESTFul nested resources 3 levels

I can write the correct route for 2 levels

cities has_many areas

map.resources :cities do |cities|
cities.resources :areas, :member => { :network => :get }
end

whatif I need a 3rd level : areas has_many domains … and even a
4th level

i would like to use the routes like :

http://0.0.0.0:3000/cities/31555/areas/0/domains/1.xml

should I nest like that ? (seems not to be working…)

map.resources :cities do |cities|
map.resources :areas do |areas|
areas.resources :domains, :member => { :network => :get }
end
end

thanks for helping me to REST in peace…

kad

See if this helps:

http://weblog.jamisbuck.org/2007/2/5/nesting-resources

Jim

jimtron wrote:

See if this helps:

Buckblog: Nesting resources

Jim

thanks … very helpful !