Skip to content

Instantly share code, notes, and snippets.

@robbyrussell
Created January 27, 2009 22:28
Show Gist options
  • Select an option

  • Save robbyrussell/53607 to your computer and use it in GitHub Desktop.

Select an option

Save robbyrussell/53607 to your computer and use it in GitHub Desktop.
map.resources :containers do |container|
container.resources :widgets
end
# gives us...
# /containers/:container_id
# /containers/:container_id/widgets/
# /containers/:container_id/widgets/:id
# but what i really want is...
# /containers/:container_id/:id
# ...sans 'widget'
# i can haz help?
this works...
map.resources :containers do |container|
container.widget '/:id', :controller => 'widgets', :action => 'show'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment