aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/getting_started.textile
diff options
context:
space:
mode:
authorJaime Iniesta <jaimeiniesta@gmail.com>2010-07-11 19:17:36 +0200
committerJaime Iniesta <jaimeiniesta@gmail.com>2010-07-11 19:17:36 +0200
commitb0fab0c5c400bc5ca10908643e8b543767e50a29 (patch)
tree81ed4beaae7d38a6577a22894f904a47888ee0a1 /railties/guides/source/getting_started.textile
parentc81e476d6d4cb88e7e29d6e18bb3e5acce92fb8f (diff)
downloadrails-b0fab0c5c400bc5ca10908643e8b543767e50a29.tar.gz
rails-b0fab0c5c400bc5ca10908643e8b543767e50a29.tar.bz2
rails-b0fab0c5c400bc5ca10908643e8b543767e50a29.zip
Getting started guide: rephrase the paragraph about the root route for better understanding
Diffstat (limited to 'railties/guides/source/getting_started.textile')
-rw-r--r--railties/guides/source/getting_started.textile9
1 files changed, 4 insertions, 5 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index f547f29087..8e018437fd 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -322,16 +322,15 @@ $ rm public/index.html
We need to do this as Rails will deliver any static file in the +public+ directory in preference to any dynamic contact we generate from the controllers.
-Now, you have to tell Rails where your actual home page is located. Open the file +config/routes.rb+ in your editor. This is your application's _routing file_ which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions. There are only comments in this file, so we need to add at the top the following:
+Now, you have to tell Rails where your actual home page is located. Open the file +config/routes.rb+ in your editor. This is your application's _routing file_ which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions. This file contains many sample routes on commented lines, and one of them actually shows you how to connect the root of your site to a specific controller and action. Find the line beginning with +:root to+, uncomment it and change it like the following:
<ruby>
Blog::Application.routes.draw do |map|
- root :to => "home#index"
-
- # The priority is based upon order of creation:
- # first created -> highest priority.
#...
+ # You can have the root of your site routed with "root"
+ # just remember to delete public/index.html.
+ root :to => "home#index"
</ruby>
The +root :to => "home#index"+ tells Rails to map the root action to the home controller's index action.