# Need help with a simple route

**URL:** <https://www.ruby-forum.com/t/need-help-with-a-simple-route/103049>\
**Category:** Rails\
**Created:** [May 1, 2007, 6:05am UTC](https://www.ruby-forum.com/t/need-help-with-a-simple-route/103049 "2007-05-01T06:05:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [May 1, 2007, 6:05am UTC](https://www.ruby-forum.com/t/need-help-with-a-simple-route/103049/1 "2007-05-01T06:05:13Z")

</div>

This is a dumb question but for some reason I can not get this to work.  
I basically just need a route that is prefixed with /components. So I  
did this:

map.components “/components/:controller/:action”

The problem is what if I have nested controllers? For example:

components/foo/bar/some\_action

It things bar is my action and doesn’t recognize my route correctly.

Is what I’m trying to do possible with routes?

thanks for your help

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [May 1, 2007, 6:21am UTC](https://www.ruby-forum.com/t/need-help-with-a-simple-route/103049/2 "2007-05-01T06:21:25Z")

</div>

Ben J. wrote:

> It things bar is my action and doesn’t recognize my route correctly.
> 
> Is what I’m trying to do possible with routes?
> 
> thanks for your help

Just add another route:

map.connect ‘/components/foo/:controller/:action’

–  
Michael W.
