# Replace the default home page

**URL:** <https://www.ruby-forum.com/t/replace-the-default-home-page/171872>\
**Category:** Rails\
**Created:** [July 10, 2009, 2:25pm UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872 "2009-07-10T14:25:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [July 10, 2009, 2:25pm UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/1 "2009-07-10T14:25:12Z")

</div>

How to replace the default home page. I tried map.root but it didn’t  
work. I should request to please provide me ways.

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [July 10, 2009, 2:27pm UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/2 "2009-07-10T14:27:51Z")

</div>

Delete or rename public/index.html ?

Sijo

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [July 10, 2009, 2:29pm UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/3 "2009-07-10T14:29:18Z")

</div>

Hello,

First, you should delete the file public/index.html if you want another  
controller to be called on your home page.  
Once it’s done, you just have to add the line  
map.root :controller =\> ‘your\_controller’  
(and maybe the action required if it’s not index) to your  
config/routes.rb  
and it’s over.  
Since routes is loaded on your server startup, you’ll have to restart it  
too.

Cyril

2009/7/10 Vikas [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [November 30, 2009, 11:10pm UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/4 "2009-11-30T23:10:23Z")

</div>

Hello,

I’ve followed steps 1 to 5 here:  
[rails.info](http://guides.rails.info/getting_started.html) and I am getting 500 error  
when trying to access [http://localhost/home/index](http://localhost/home/index).

The standard welcome page in public worked so I assume the Mongrel is  
up.

- I deleted the welcome page;
- Using script/generate I created home/index in app/views;
- This is how my routes.rb looks like:

ActionController::Routing::Routes.draw do |map|  
map.root :controller =\> “home”  
map.connect ‘:controller/:action/:id’  
map.connect ‘:controller/:action/:id.:format’  
end

- I restarted Mongrel and entered [http://localhost/home/index](http://localhost/home/index) in Firefox  
browser started with clean session.

Result: RoR custom 500 error page. What am I doing wrong?

* * *

\*\*\*\*\*\*\* Windows Vista \*\*\*\*\*\*\*\*\*

c:\RubyProjects\project\_one\public\>gem env  
RubyGems Environment:

- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
- INSTALLATION DIRECTORY: c:/Ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: c:/Ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: c:/Ruby/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-mswin32-60

- GEM PATHS:
  - c:/Ruby/lib/ruby/gems/1.8
  - C:/Users/Victor/.gem/ruby/1.8

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://gems.rubyforge.org/](http://gems.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [December 1, 2009, 1:34am UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/5 "2009-12-01T01:34:36Z")

</div>

I attached the full error in development log. Looks like something wrong  
with MySQL…

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [December 1, 2009, 1:29am UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/6 "2009-12-01T01:29:03Z")

</div>

In addition to my previous post.

I looked into development log and there is this:

Status: 500 Internal Server Error  
Access denied for user ‘root’@‘localhost’ (using password: NO)

Where is it trying to access user “root” at “localhost”?

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [December 1, 2009, 5:03am UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/7 "2009-12-01T05:03:45Z")

</div>

Hi Vi Le

Assuming you gave details like username,password etc.After that  
problem still exists try this from mysql konsole

GRANT ALL PRIVILEGES ON _._ TO root@localhost IDENTIFIED BY  
‘root\_password’ WITH GRANT

The above you can also setup to any other mysql user than root

Sijo

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [December 1, 2009, 3:58am UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/8 "2009-12-01T03:58:36Z")

</div>

Vi Le wrote:

> In addition to my previous post.
> 
> I looked into development log and there is this:
> 
> Status: 500 Internal Server Error  
> Access denied for user ‘root’@‘localhost’ (using password: NO)
> 
> Where is it trying to access user “root” at “localhost”?

That’s a database connection error. Check your database.yml file.

Best,  
–Â  
MarnenÂ Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![vikas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ac91a4/32.png) [@vikas](https://www.ruby-forum.com/u/vikas)\
**Post date:** [December 1, 2009, 6:50am UTC](https://www.ruby-forum.com/t/replace-the-default-home-page/171872/9 "2009-12-01T06:50:45Z")

</div>

Ok, obviously this is MySQL problem. I can’t even access it via MySQL  
Administrator. I get:

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using  
password: YES).

I need to figure that one out first.

Thanks for pointing me in the right direction.
