# Routing Problem

**URL:** <https://www.ruby-forum.com/t/routing-problem/104021>\
**Category:** Rails\
**Created:** [May 13, 2007, 1:08am UTC](https://www.ruby-forum.com/t/routing-problem/104021 "2007-05-13T01:08:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e9a140/32.png) [@skade](https://www.ruby-forum.com/u/skade)\
**Post date:** [May 13, 2007, 1:08am UTC](https://www.ruby-forum.com/t/routing-problem/104021/1 "2007-05-13T01:08:02Z")

</div>

Hi, I have the following route setup

–  
map.auth ‘users/auth/:action/:id’,  
:controller =\> ‘users/auth’, :action =\> nil, :id =\> nil

map.authadmin ‘users/authadmin/:action/:id’,  
:controller =\> ‘users/authadmin’, :action =\> nil, :id =\> nil

# Allow downloading Web Service WSDL as a file with an extension

# instead of a file named ‘wsdl’

map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’  
map.admin ‘admin/:controller/:action/:id’, :module =\> ‘admin’  
map.file\_upload ‘file\_uploader/:controller/:action/:id’, :module =\>  
‘file\_uploader’

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

# Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id’, :lang =\> ‘de’

## map.index ‘’, :lang =\> ‘de’, :controller =\> ‘employees’

and the following problem:

This works like a charm on my development system, but has an error on my  
production system (textdrive). It should recognize  
‘my\_host/admin/employees’ as a route to Admin::EmployeesController and  
‘my\_host/employees’ as one to EmployeesController. The above code  
usually works.

On Textdrive, this first route gets recognized as a route to  
EmployeesController with params {:lang =\> ‘admin’, :controller =\>  
‘employees’}, although map.admin is defined first. map.auth an  
map.file\_upload both work fine. Rails is found in vendor and is thus the  
same version on both systems. Does anyone have an idea what could cause  
this behaviour?

P.S.: If you wonder about :module, this is a small hack to make it  
possible to force a module:

module ActionController  
module Routing  
class RouteSet  
def recognize(request)  
params = recognize\_path(request.path,  
extract\_request\_environment(request))  
request.path\_parameters = params.with\_indifferent\_access

```
    controller = [params[:module],

```

params[:controller]].compact.join(’/’)

```
    "#{controller.camelize}Controller".constantize
  end
end

```

end  
end

P.P.S.: Please, I don’t want to discuss whether or not to use  
controllers in modules.
