creating a homepage in Rails?
I'm brand new to Ruby o开发者_JAVA百科n 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!
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
I suggest going through the getting started guide which takes you through this process.
You need to delete the file index.html from the public directory inside your application.
精彩评论