I'm trying to set a default controller in my Rails routing. The default controller should be 'main'.
For example, I want /about to route to /main/about.
Here's what I have, but it doesn't work:
map.connect ':controller/:action/:id', :controller => 'main'
Can anyone help?
People succeed in answering Carl Mercier's questions 23% of the time (5 successes in 22 attempts).
Answers by: Zachary Holt
This will work if your actions are all one level.
map.connect ':action', :controller => 'main'
If it's the default, however, I prefer to do this, and parse params[:everything] in MainController
map.connect '*everything', :controller => 'main'
One freebie ;)
That worked! (map.connect ':action', :controller => 'main') Thanks!!!
I just did something with the counter offer. Not sure what. Disregard.