views:

60

answers:

3

I'm brand new to Ruby on Rails. I created a project by calling:

Rails hello

And I can access the project by going to http://127.0.0.1/hello, but when I leave off the "hello" from the URL I just get a generic homepage saying welcome to ruby. What's the best way to replace this homepage with a homepage for my project?

Thanks!

A: 

You need to delete the file index.html from the public directory inside your application.

Jeff Paquette
+6  A: 

As flyfishr64 said, you have to delete public/index.html. But it's not enough. You will also need to add following to your routes.rb:

map.root :controller => :hello, :action => :index
stask
Won't the default route ( map.connect ':controller/:action/:id') handle this?
Jeff Paquette
why would it handle that without any controller specified in the url?
Matt Briggs
Matt Briggs is right, also this provides a handy way to link to the home page: `link_to "Home", root_url`
EmFi
+1  A: 

I suggest going through the getting started guide which takes you through this process.

Ryan Bigg