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

B681feb514f5756a45a4f106cf0f32de?d=identicon&s=25 Samuel All aboard (samuelgilman)
on 2008-07-26 05:50
NTS:

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

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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.