# Static urls for dynamic conent (routing question)

**URL:** <https://www.ruby-forum.com/t/static-urls-for-dynamic-conent-routing-question/109782>\
**Category:** Rails\
**Created:** [July 19, 2007, 12:46am UTC](https://www.ruby-forum.com/t/static-urls-for-dynamic-conent-routing-question/109782 "2007-07-19T00:46:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 19, 2007, 12:46am UTC](https://www.ruby-forum.com/t/static-urls-for-dynamic-conent-routing-question/109782/1 "2007-07-19T00:46:51Z")

</div>

Hi,

I wanna provide static urls for my users, and I figured out that I can  
do it with the following:

map.user ‘:username’, :controller =\> ‘users’, :action =\> ‘show’

however, I also have the following in my routes.rb, which essentially  
creates a default controller:

map.account ‘:action/:id’, :controller =\> “account”

basically, this shortens my urls, where i once had:  
[www.mysite.com/account/login](http://www.mysite.com/account/login),  
now can be accessed by [www.mysite.com/login](http://www.mysite.com/login) (there are many other  
commonly used actions in the account controller)

My problem is i cant have both of these lines together in my  
routes.rb…basically, whichever one comes first, takes priority, and  
wont let the other one behave as expected.

For example, if the map.user is first, and I enter:  
[www.mysite.com/login](http://www.mysite.com/login),  
I will get an error sayin to user: ‘login’ found…if I put  
map.account first, and enter [www.mysite.com/userA](http://www.mysite.com/userA), I will get an error  
sayin no action userA found in controller account.

Does anyone know how to get around this? Is there a way to call a  
default action in my account controller if no action is found? i can  
search for a user that way.

Thanks!
