Skip to content

Instantly share code, notes, and snippets.

@hoverlover
Created October 25, 2011 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoverlover/1311330 to your computer and use it in GitHub Desktop.
Save hoverlover/1311330 to your computer and use it in GitHub Desktop.
Map a scoped resource to a controller with an unrelated namespace
Sample::Application.routes.draw do
# Route /a/b -> Foo::BarsController. This is useful
# when you need to conform to a certain url structure
# while using a controller that doesn't match that structure,
# eg. a controller supplied by a Rails engine.
scope '/a' do
resources :b, controller: 'bars', module: 'foo'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment