# Routes with parameters ordered differently

**URL:** <https://www.ruby-forum.com/t/routes-with-parameters-ordered-differently/161331>\
**Category:** Rails\
**Created:** [February 25, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/routes-with-parameters-ordered-differently/161331 "2009-02-25T15:52:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kailas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@kailas](https://www.ruby-forum.com/u/kailas)\
**Post date:** [February 25, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/routes-with-parameters-ordered-differently/161331/1 "2009-02-25T15:52:00Z")

</div>

Hi, i’m trying to setup a custom route and having some trouble.

In various resources i’ve seen plenty of examples of how to do something  
along the lines of:

map.connect “foo/bar/:a/:b/:c”,  
:controller =\> “foo”,  
:action =\> “bar”,

(and :a,:b and :c get mapped to params[])

what i’d like to do is make a mapping of the form

map.connect “:foo/:controller/:action/:id”

i’d like to do something like this so people can, say, choose a locale  
in the url as the param[:foo] (like  
[http://myserver:3000/en/somecontroller/someaction/](http://myserver:3000/en/somecontroller/someaction/))

is that possible? i tried adding the route:

map.connect “:foo/:controller/:action/:id”

and when i try to go to an address like the one i specified, it returns  
that no route matches.

I’ve seen other posts in the archives that suggest this should work, but  
maybe there’s something additional that needs to be done?

any help is greatly appreciated.

thanks!

-k
