I know that in Rails (3.2.2), I can route requests to / with the following in routes.rb:
root :to => 'main_pages#index'
How can I make MainPages the default controller for all index actions?
For example, if I used rails g controller to make a new controller called “Foo” with actions “hi” and “bye”, Rails would automatically route myapp/foo/hi and myapp/foo/bye.
How can I make MainPages the default controller for index actions, so if I make a method in MainPages called “about”, Rails will route /about?
Edit
Then, once I’ve routed that, should I link to these new pages with link_to or just use a direct path?
One default Rails route is :
You could override it with your controller name :