Routing problem: nested Controller interpreted as Action


I moved my application to server where is newest Rails version
(1.2.6). On my local machine I tested my app under 1.2.3.

On the server my nested controllers (“admin/user”) is interpreted as

Parameters: {“action”=>“user”, “controller”=>“admin”}

Locally it works perfect:

Parameters: {“action”=>“index”, “controller”=>“admin/user”}

My routes.rb doesn’t include some special lines:

ActionController::Routing::Routes.draw do |map|

The priority is based upon order of creation: first created ->

highest priority.

Sample of regular route:

map.connect ‘products/:id’, :controller => ‘catalog’, :action =>


Keep in mind you can assign values other than :controller

and :action

Sample of named route:

map.purchase ‘products/:id/purchase’, :controller =>

‘catalog’, :action => ‘purchase’

This route can be invoked with purchase_url(:id =>

You can have the root of your site routed by hooking up ‘’

– just remember to delete public/index.html.

map.connect ‘’, :controller => “welcome”

map.connect ‘’, :controller => ‘login’

Allow downloading Web Service WSDL as a file with an extension

instead of a file named ‘wsdl’

map.connect ‘:controller/service.wsdl’, :action => ‘wsdl’

Install the default route as the lowest priority.

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

Ho to set it? Thx for any help!

I solved the problem. But I think that I can make it better way (??)
I added to my routes.rb

map.connect ‘admin/user/:action/:id’, :controller => ‘admin/user’

It works. It’s not comfortable because for each nested controller I
have to add extra line in routes.rb

I tried some universal solution but it doesn’t work:

map.connect ‘admin/:controller/:action/:id’, :controller =>

any ideas? :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs