about routes

0 views
Skip to first unread message

trencaclosques

unread,
Sep 4, 2010, 10:11:33 AM9/4/10
to Ruby on Rails: Talk
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.

trencaclosques

unread,
Sep 4, 2010, 6:57:01 PM9/4/10
to Ruby on Rails: Talk
I forgot to say that I'm using Rails 3 and Ruby 1.9.2 .
Reply all
Reply to author
Forward
0 new messages