Forum: Ruby on Rails app at root domain

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jason S. (Guest)
on 2006-06-09 21:18
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
Tom M. (Guest)
on 2006-06-09 21:34
(Received via mailing list)
Check config/routes.rb

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

--
-- Tom M.
Trevor S. (Guest)
on 2006-06-09 21:40
(Received via mailing list)
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
Alex W. (Guest)
on 2006-06-09 21:46
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'
Jason S. (Guest)
on 2006-06-09 23:44
Perfect... thanks fellas!
This topic is locked and can not be replied to.