Forum: Setting URL root / change Public/index.html default

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
B681feb514f5756a45a4f106cf0f32de?d=identicon&s=25 Samuel All aboard (samuelgilman)
on 2008-07-26 05:50

The default URL for a new rails app is the index.html file in the Public

If you want to change the default to another page, do the following:

In the routes.rb file in the Public folder add the following code at the
lowest priority, or right before "end", the last word in the document:

   map.connect '', :controller => "controller_you_want_as_a_default"

- make sure you have an index.rhtml file in the view associated with the
controller you insert in the latter code.

- or make sure that you render/redirect the index def to an action with
a view.

- or follow your customizations if you have something besides index.html
as the default.
This topic is locked and can not be replied to.