App at root domain


#1

I have my app up and running at www.domainname.com/controller/ … but
need to get it set up at just www.domainname.com

I see that by default, rails is loading the pre-made index file in the
/public dir. How can I override this without changing any directories
around in my app?

Thanks!
-stirman


#2

Check config/routes.rb

There’s a commented line in there that shows how to do this.


– Tom M.


#3

Hey,

First off, you need to remove the public/index.html file.

Then in config/routes.rb

map.connect ‘’, :controller => ‘your_main_controller’, :action =>
‘probably_index’

Note, the first arg to connect is a set of empty quotes.

Regards,
Trevor

Trevor S.
http://somethinglearned.com


#4

Perfect… thanks fellas!


#5

Jason S. wrote:

I have my app up and running at www.domainname.com/controller/ … but
need to get it set up at just www.domainname.com

I see that by default, rails is loading the pre-made index file in the
/public dir. How can I override this without changing any directories
around in my app?

Thanks!
-stirman

  1. delete public/index.html

  2. add a route in config/routes.rb that looks like:

    map.home ‘’,
    :controller => ‘some_controller’,
    :action => ‘index’