# How to make index.html share with standard-layout.rhtml?

**URL:** <https://www.ruby-forum.com/t/how-to-make-index-html-share-with-standard-layout-rhtml/70920>\
**Category:** Rails\
**Created:** [October 3, 2006, 11:57pm UTC](https://www.ruby-forum.com/t/how-to-make-index-html-share-with-standard-layout-rhtml/70920 "2006-10-03T23:57:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roseanne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@roseanne](https://www.ruby-forum.com/u/roseanne)\
**Post date:** [October 3, 2006, 11:57pm UTC](https://www.ruby-forum.com/t/how-to-make-index-html-share-with-standard-layout-rhtml/70920/1 "2006-10-03T23:57:23Z")

</div>

I can make all my pages in app/view share the same look and feel by  
using standard-layout.rhtml.

However, when I go the root url: [http://localhost:3000/](http://localhost:3000/) I get the  
/public/index.html. It does not share the same layout. I currently hard  
coded in index.html to make it look and feel the same.

I believe that I must miss something simple and obvious, please help!

Thanks in Advance!  
Roseanne

---

<div class="post-metadata">

**Author:** ![roseanne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@roseanne](https://www.ruby-forum.com/u/roseanne)\
**Post date:** [October 4, 2006, 12:22am UTC](https://www.ruby-forum.com/t/how-to-make-index-html-share-with-standard-layout-rhtml/70920/2 "2006-10-04T00:22:57Z")

</div>

> I can make all my pages in app/view share the same look and feel by  
> using standard-layout.rhtml.
> 
> However, when I go the root url: [http://localhost:3000/](http://localhost:3000/) I get the  
> /public/index.html. It does not share the same layout. I currently hard  
> coded in index.html to make it look and feel the same.
> 
> I believe that I must miss something simple and obvious, please help!

Create a default controller for “[myserver.com](http://myserver.com)”, say “home\_controller”  
with  
an ‘index’ action.

./script/generate controller home index

Then adjust config/routes.rb to include this near the top:

map.connect ‘’, :controller =\> “home”

Then take the _content_ in public/index.html and put it in  
app/views/home/index.rhtml.

Then remove public/index.html.

Then make sure it all works 🙂 Once it works, add the following line to  
your HomeController (outside/above ‘dev index’):

caches\_page :index

Then just remember that if you change app/views/home/index.rhtml you  
need  
to remove public/index.html.

Good luck!

-philip

---

<div class="post-metadata">

**Author:** ![roseanne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@roseanne](https://www.ruby-forum.com/u/roseanne)\
**Post date:** [October 4, 2006, 12:31am UTC](https://www.ruby-forum.com/t/how-to-make-index-html-share-with-standard-layout-rhtml/70920/3 "2006-10-04T00:31:00Z")

</div>

Philip H. wrote:

> Create a default controller for “[myserver.com](http://myserver.com)”, say “home\_controller”  
> with  
> an ‘index’ action.
> 
> ./script/generate controller home index

Thank you very much for your reply, I will try it now.

Roseanne
