Rails Default Controller for Site Root

To designate a particular controller so that all of its methods appear off the root of your site, add the following to routes.rb inside the ActionController::Routing::Routes.draw do |map| block:

    map.connect ':action', :controller => "yourcontrollername"

One Reply to “Rails Default Controller for Site Root”

  1. thanks..
    I tried
    map.connect ”, :controller => “yourcontrollername”
    map.connect ”, :controller => “yourcontrollername”, :action => “index”

    but they didn’t worked for me.

    finally
    map.connect ‘:action’, :controller => “yourcontrollername”

    worked

    cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.