how can i disable the named routes generated in a nestes route

in routes.rb, code like :
  map.resources :users do |user|
    user.resources :addressbooks
  end

will generate routes like '/users/1/addressbooks/1' and '/addressbooks/
1'.
My question is that how i can disable the later route? and only make
the former( '/users/1/addressbooks/1') work.

That route is available via the default routes installed by Rails
at the bottom of routes.rb

Install the default routes as the lowest priority.

map.connect ‘:controller/:action/:id’

map.connect ‘:controller/:action/:id.:format’

You can comment those out but be careful to add :collection and :member
parameters to your resource mappings if you use custom actions.

Franz

thanks. it's working now.