# About routes

**URL:** <https://www.ruby-forum.com/t/about-routes/194460>\
**Category:** Rails\
**Created:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/about-routes/194460 "2010-09-06T16:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trencaclosques](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aeb1de/32.png) [@trencaclosques](https://www.ruby-forum.com/u/trencaclosques)\
**Post date:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/about-routes/194460/1 "2010-09-06T16:39:33Z")

</div>

Hello everyone,

I’m trying to map a controller actions with the name as a action. I’ve  
got it well:

match “/home” =\> “main#home”, :as =\> :home  
match “/contact” =\> “main#contact”, :as =\> :contact  
match “/whoweare” =\> “main#whoweare”, :as =\> :whoweare

But I want to do this with only one line of code. I’ve tried it with  
this line, but it don’t work:

match ‘:action’ =\> ‘main#:action’, :as =\> :action

Any idea? Thanks and greetings.

---

<div class="post-metadata">

**Author:** ![trencaclosques](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aeb1de/32.png) [@trencaclosques](https://www.ruby-forum.com/u/trencaclosques)\
**Post date:** [September 6, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/about-routes/194460/2 "2010-09-06T16:44:05Z")

</div>

I forgot to say that I’m using Rails 3 and Ruby 1.9.2 .
