Skip to content

Commit

Permalink
Clarified removal of public/index.html file
Browse files Browse the repository at this point in the history
Signed-off-by: Trent Michaels <t.michaels@modcloth.com>
  • Loading branch information
cmacaluso authored and tm080201 committed Mar 1, 2013
1 parent baa32a5 commit f8461f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions guides/source/getting_started.md
Expand Up @@ -241,6 +241,8 @@ root to: "welcome#index"


The `root to: "welcome#index"` tells Rails to map requests to the root of the application to the welcome controller's index action and `get "welcome/index"` tells Rails to map requests to <http://localhost:3000/welcome/index> to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`). The `root to: "welcome#index"` tells Rails to map requests to the root of the application to the welcome controller's index action and `get "welcome/index"` tells Rails to map requests to <http://localhost:3000/welcome/index> to the welcome controller's index action. This was created earlier when you ran the controller generator (`rails generate controller welcome index`).


You should also remove the `public/index.html` file because it might otherwise take precedence over the routes defined in `config/routes.rb`.

If you navigate to <http://localhost:3000> in your browser, you'll see the `Hello, Rails!` message you put into `app/views/welcome/index.html.erb`, indicating that this new route is indeed going to `WelcomeController`'s `index` action and is rendering the view correctly. If you navigate to <http://localhost:3000> in your browser, you'll see the `Hello, Rails!` message you put into `app/views/welcome/index.html.erb`, indicating that this new route is indeed going to `WelcomeController`'s `index` action and is rendering the view correctly.


TIP: For more information about routing, refer to [Rails Routing from the Outside In](routing.html). TIP: For more information about routing, refer to [Rails Routing from the Outside In](routing.html).
Expand Down

0 comments on commit f8461f7

Please sign in to comment.