# Adding the root index page?

**URL:** <https://www.ruby-forum.com/t/adding-the-root-index-page/85140>\
**Category:** Rails\
**Created:** [February 10, 2007, 1:42pm UTC](https://www.ruby-forum.com/t/adding-the-root-index-page/85140 "2007-02-10T13:42:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![etikette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/43a26b/32.png) [@etikette](https://www.ruby-forum.com/u/etikette)\
**Post date:** [February 10, 2007, 1:42pm UTC](https://www.ruby-forum.com/t/adding-the-root-index-page/85140/1 "2007-02-10T13:42:19Z")

</div>

hi all (newbie here)

what is the best way to create a dynamic root to your ROR application,  
i.e. to the address: [http://localhost:3000](http://localhost:3000). By default this is created  
in the public folder as a html page.

I was wondering whether I should delete this page and create a new one  
in the app, and if this is the case how do i configure the controller  
and view to display this page?

---

<div class="post-metadata">

**Author:** ![etikette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/43a26b/32.png) [@etikette](https://www.ruby-forum.com/u/etikette)\
**Post date:** [February 10, 2007, 2:11pm UTC](https://www.ruby-forum.com/t/adding-the-root-index-page/85140/2 "2007-02-10T14:11:08Z")

</div>

Hi, you can easily edit the index.html located in your RoR app’s public  
folder.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![etikette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/43a26b/32.png) [@etikette](https://www.ruby-forum.com/u/etikette)\
**Post date:** [February 10, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/adding-the-root-index-page/85140/3 "2007-02-10T15:08:15Z")

</div>

Just add an index action on whatever controller you’re using to serve up  
whatever. [Specific, huh?] Add a route like so…

map.index “/”, :controller =\> [your controller], :action =\> “index”

It’s that simple. If it doesn’t fit in neatly with any of your other  
controllers, you might want to just plop that index method into  
ApplicationController. Just make sure the routing directs the base path  
to  
the right controller and method. No need to rely on a static page.

RSL

---

<div class="post-metadata">

**Author:** ![etikette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/43a26b/32.png) [@etikette](https://www.ruby-forum.com/u/etikette)\
**Post date:** [February 10, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/adding-the-root-index-page/85140/4 "2007-02-10T16:29:27Z")

</div>

Russell N. wrote:

> RSL  
> Yes, just edit config/routes.rb and it’s written right there in the  
> comments.

–  
Chris M.  
Web D.

> **[Chriscodes.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=chriscodes.com)**
>
> Painless, quick delivery of your domain name. Fast and professional service.
