# How to set a page of root/ dir of a site

**URL:** <https://www.ruby-forum.com/t/how-to-set-a-page-of-root-dir-of-a-site/161835>\
**Category:** Rails\
**Created:** [March 2, 2009, 11:28pm UTC](https://www.ruby-forum.com/t/how-to-set-a-page-of-root-dir-of-a-site/161835 "2009-03-02T23:28:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [March 2, 2009, 11:28pm UTC](https://www.ruby-forum.com/t/how-to-set-a-page-of-root-dir-of-a-site/161835/1 "2009-03-02T23:28:21Z")

</div>

Hi all,

I have started making a site in ruby/rails and just wondering how to  
set the page for the root/ dir of the site as i have got the other pages  
done ie:-

example/dir1  
example/dir2  
example/dir3  
example/dir4

but just wondering how to set the example/ page as it always appears as  
the welcome to ruby page

any help will be great

thanks

paul

---

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [March 2, 2009, 11:43pm UTC](https://www.ruby-forum.com/t/how-to-set-a-page-of-root-dir-of-a-site/161835/2 "2009-03-02T23:43:13Z")

</div>

Peter V. wrote:

> On Mon, Mar 2, 2009 at 11:28 PM, Paul Na  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > the welcome to ruby page  
> > I see 2 steps:
> 
> 1. move the /public/index.html file to another name (e.g. $mv  
> index.html index.html.ORIG)
> 
> 2. add a route for ‘/’ in config/routes.rb
> 
> in the config/routes.rb near the the bottom of the file, but before  
> the default routes,  
> do something along the lines of
> 
> map.connect( ‘’, :controller=\>‘home’)
> 
> if you have a app/controllers/home\_controller.rb
> 
> HTH,
> 
> Peter

Hi peter

thanks for that, thats helped alot

thanks again

---

<div class="post-metadata">

**Author:** ![nanouk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@nanouk](https://www.ruby-forum.com/u/nanouk)\
**Post date:** [March 2, 2009, 11:39pm UTC](https://www.ruby-forum.com/t/how-to-set-a-page-of-root-dir-of-a-site/161835/3 "2009-03-02T23:39:47Z")

</div>

On Mon, Mar 2, 2009 at 11:28 PM, Paul Na  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> the welcome to ruby page  
> I see 2 steps:

1. move the /public/index.html file to another name (e.g. $mv  
index.html index.html.ORIG)

2. add a route for ‘/’ in config/routes.rb

in the config/routes.rb near the the bottom of the file, but before  
the default routes,  
do something along the lines of

map.connect( ‘’, :controller=\>‘home’)

if you have a app/controllers/home\_controller.rb

HTH,

Peter
