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.
B20f60d4dae0d5f372c73caf1418565a?d=identicon&s=25 Jason Stirman (stirman)
on 2006-06-09 19: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
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-06-09 19:34
(Received via mailing list)
Check config/routes.rb

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

--
-- Tom Mornini
27c170f482104299af279902be0a9c26?d=identicon&s=25 Trevor Squires (Guest)
on 2006-06-09 19: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 Squires
http://somethinglearned.com
D0cd6b10e01bacb976b3b815a9c660bc?d=identicon&s=25 Alex Wayne (Guest)
on 2006-06-09 19:46
Jason Stirman 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'
B20f60d4dae0d5f372c73caf1418565a?d=identicon&s=25 Jason Stirman (stirman)
on 2006-06-09 21:44
Perfect... thanks fellas!
This topic is locked and can not be replied to.