# Map.root doesn't do anything, index.html can't be changed

**URL:** <https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476>\
**Category:** Rails\
**Created:** [July 8, 2008, 11:19am UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476 "2008-07-08T11:19:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuxygen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/779978/32.png) [@nuxygen](https://www.ruby-forum.com/u/nuxygen)\
**Post date:** [July 8, 2008, 11:19am UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476/1 "2008-07-08T11:19:03Z")

</div>

Environment:

Apache/2.2.8 (Ubuntu)  
DAV/2  
SVN/1.4.6  
PHP/5.2.4-2ubuntu5.1 with Suhosin-Patch  
mod\_ruby/1.2.6  
Ruby/1.8.6(2007-09-24)  
mod\_ssl/2.2.8  
OpenSSL/0.9.8g  
Phusion\_Passenger/2.0.1 Server

I’ve created several scaffolds that all work, and am trying to set the  
root page for this app to default to one of the methods. Here’s my  
routes.rb:

ActionController::Routing::Routes.draw do |map|  
map.resources :physicians  
map.resources :patients  
map.resources :inventory\_items  
map.root :controller =\> ‘inventory\_items’  
map.connect ‘:controller/:action/:id’  
map.connect ‘:controller/:action/:id.:format’  
end

when I go to my root URI, I get the same old “Welcome aboard!” page.

To make things even more weird, I can modify and/or delete the  
index.html page that is being displayed, with or without the map.root  
entry, and the _exact_ same page is displayed anyway. I’ve even grepped  
every file in this application to make sure there is no other file with  
the word “Welcome” in it, and there isn’t.

I’ve restarted apache every time I make a modificaiton to the routes.rb,  
just in case it’s caching some how.

It looks like the only way I’ll be able to override the index of the  
root of the application is to rewrite the URI in the apache  
configuration, to change “/” to “/my\_method/my\_action”.

Anybody else have a problem like this?

---

<div class="post-metadata">

**Author:** ![nuxygen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/779978/32.png) [@nuxygen](https://www.ruby-forum.com/u/nuxygen)\
**Post date:** [July 8, 2008, 12:34pm UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476/2 "2008-07-08T12:34:10Z")

</div>

> when I go to my root URI, I get the same old “Welcome aboard!” page.
> 
> To make things even more weird, I can modify and/or delete the  
> index.html page that is being displayed, with or without the map.root  
> entry, and the _exact_ same page is displayed anyway. I’ve even grepped  
> every file in this application to make sure there is no other file with  
> the word “Welcome” in it, and there isn’t.

This sounds like you’re not modifying the files you think you are -  
clearly a file cannot be conjured out of thing air

Fred

---

<div class="post-metadata">

**Author:** ![nuxygen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/779978/32.png) [@nuxygen](https://www.ruby-forum.com/u/nuxygen)\
**Post date:** [July 8, 2008, 2:30pm UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476/3 "2008-07-08T14:30:57Z")

</div>

Are you sure your browser hasn’t cached the page so that it comes up  
automatically. I’ve never had a problem like this one before.

Also, and this is for everyone: do we need to specify an :action =\>  
when we’re mapping the root?

On Jul 8, 4:19 am, Richard P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![nuxygen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/779978/32.png) [@nuxygen](https://www.ruby-forum.com/u/nuxygen)\
**Post date:** [July 8, 2008, 9:24pm UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476/4 "2008-07-08T21:24:16Z")

</div>

Despair not! Four hours lost now will mean never having to worry about  
the same problem again!

On Jul 8, 1:41 pm, Richard P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![nuxygen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/779978/32.png) [@nuxygen](https://www.ruby-forum.com/u/nuxygen)\
**Post date:** [July 8, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476/5 "2008-07-08T20:41:08Z")

</div>

> This sounds like you’re not modifying the files you think you are -  
> clearly a file cannot be conjured out of thing air
> 
> Fred

And so it was… (sigh)

The directory in web directory was linking to the wrong app all along…

I was thinking maybe it was something weird about the caching.

grrrrr

Four hours down the drain.

---

<div class="post-metadata">

**Author:** ![nuxygen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/779978/32.png) [@nuxygen](https://www.ruby-forum.com/u/nuxygen)\
**Post date:** [July 23, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/map-root-doesnt-do-anything-index-html-cant-be-changed/142476/6 "2008-07-23T13:28:56Z")

</div>

You can delete the index.html under public folder, then this problem  
never happen again
