# Routing problem with controllers in other dirs

**URL:** <https://www.ruby-forum.com/t/routing-problem-with-controllers-in-other-dirs/90724>\
**Category:** Rails\
**Created:** [March 31, 2007, 2:39pm UTC](https://www.ruby-forum.com/t/routing-problem-with-controllers-in-other-dirs/90724 "2007-03-31T14:39:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![enc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@enc](https://www.ruby-forum.com/u/enc)\
**Post date:** [March 31, 2007, 2:39pm UTC](https://www.ruby-forum.com/t/routing-problem-with-controllers-in-other-dirs/90724/1 "2007-03-31T14:39:14Z")

</div>

Hi all

I have a problem with mapping url to controller which is deeper in  
controller directory (not root directory). I wanted to move  
acts\_as\_authenticated account\_controller deeper to directory (let’s  
call it Foo) and route it as /Foo/Account, but i always seem to get  
exception that no route matched my request

file structure:  
/app  
± /controllers  
± /Foo  
± /account\_controller.rb

– routes.rb –  
map.connect ‘Foo’, :controller =\> ‘/Foo/Index’  
map.connect ‘Foo/:controller/:action/:id’  
…  
– ~ routes.rb –

– /Foo/account\_controller.rb –  
class Foo::AccountController \< ApplicationController  
– ~ /Foo/account\_controller.rb –

Strange thing is - when i point my browser to [mydomain.com/Foo](http://mydomain.com/Foo) i  
always get redirected to /Foo/account/login (where exception takes  
place), that means - get right routing for /Foo/Index controller which  
is:  
class Foo::IndexController \< Foo::AccountController

Even more strange thing: this worked on RoR 1.2.2. I began getting  
exceptions after i upgraded to RoR 1.2.3. I’m quite lost. I’ve already  
tried IRC channel in [freenode.net](http://freenode.net)

Thanks for any help.
