public
Created

Map a scoped resource to a controller with an unrelated namespace

  • Download Gist
routes.rb
Ruby
1 2 3 4 5 6 7 8 9
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.