# Route to a controller outside of a namespace

**URL:** <https://www.ruby-forum.com/t/route-to-a-controller-outside-of-a-namespace/157348>\
**Category:** Rails\
**Created:** [January 9, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/route-to-a-controller-outside-of-a-namespace/157348 "2009-01-09T18:01:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottnj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@scottnj](https://www.ruby-forum.com/u/scottnj)\
**Post date:** [January 9, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/route-to-a-controller-outside-of-a-namespace/157348/1 "2009-01-09T18:01:18Z")

</div>

i have a couple controller namespaces in my app and to keep things  
DRY, i would like to use a common controller in some of them.

when i try creating a route, i can not figure out how to  
set :controller to use a controller outside of the namespace.

map.namespace :user do |user|  
user.resource :something, :controller =\> “something”  
user.resource :something2, :controller =\> “/something2”  
end

{:action=\>“show”, :controller=\>“user/something”}  
{:action=\>“show”, :controller=\>“user//something2”}

i want  
{:action=\>“show”, :controller=\>“something”}

is there a way to tell rails not to automatically add the “user/” to  
the beginning of the controller name?

i guess i could create a blank User::Something controller that  
inherits from the Something controller, but it seems silly to have to  
create an extra controller.
