diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-06-27 09:55:46 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-06-27 09:55:46 -0700 |
commit | 463c08d1c2131fada69d8aefde79c5928e9015d2 (patch) | |
tree | d9f3d74cd9d215a6467bdd41571278e815ecd846 /guides/source/getting_started.md | |
parent | 34127787bbe28cedb8f9a493531582b05f0b437a (diff) | |
parent | d4dca25d9db2e53c20d699d8da85c74a8273390a (diff) | |
download | rails-463c08d1c2131fada69d8aefde79c5928e9015d2.tar.gz rails-463c08d1c2131fada69d8aefde79c5928e9015d2.tar.bz2 rails-463c08d1c2131fada69d8aefde79c5928e9015d2.zip |
Merge pull request #11145 from JeffreyRodriguez/rails_4_root_directive_updates_and_fixes
Removed "to:" from root directive and fixed typo ":to"
Diffstat (limited to 'guides/source/getting_started.md')
-rw-r--r-- | guides/source/getting_started.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 455907535b..e6c610e817 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -230,16 +230,16 @@ Blog::Application.routes.draw do # first created -> highest priority. # ... # You can have the root of your site routed with "root" - # root to: "welcome#index" + # root "welcome#index" ``` -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` and uncomment it. It should look something like the following: +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` and uncomment it. It should look something like the following: ```ruby -root to: "welcome#index" +root "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 "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`). 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. @@ -260,7 +260,7 @@ Blog::Application.routes.draw do resources :posts - root to: "welcome#index" + root "welcome#index" end ``` |