# Routing problem: nested Controller interpreted as Action

**URL:** <https://www.ruby-forum.com/t/routing-problem-nested-controller-interpreted-as-action/123012>\
**Category:** Rails\
**Created:** [December 13, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/routing-problem-nested-controller-interpreted-as-action/123012 "2007-12-13T12:18:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@newman](https://www.ruby-forum.com/u/newman)\
**Post date:** [December 13, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/routing-problem-nested-controller-interpreted-as-action/123012/1 "2007-12-13T12:18:19Z")

</div>

Hi!

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 =\>

‘view’

# 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 =\> product.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’ end

Ho to set it? Thx for any help!

---

<div class="post-metadata">

**Author:** ![newman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@newman](https://www.ruby-forum.com/u/newman)\
**Post date:** [December 13, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/routing-problem-nested-controller-interpreted-as-action/123012/2 "2007-12-13T15:43:51Z")

</div>

## 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 =\> ‘admin/:controller’

any ideas? 🙂
