Forum: Ruby on Rails Routing Problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D1f1c20467562fc1d8c8aa0d328def62?d=identicon&s=25 Florian Gilcher (skade)
on 2007-05-13 01:08
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 =>

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,
        request.path_parameters = params.with_indifferent_access

        controller = [params[:module],


P.P.S.: Please, I don't want to discuss whether or not to use
controllers in modules.
This topic is locked and can not be replied to.