From 35e0cb51f839974fa95c569d016f7141f78dcee6 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 14 Mar 2012 14:33:16 -0700 Subject: [getting started] Default root route in config/routes.rb is for a welcome controller. Let's make it easy by creating a WelcomeController, not a HomeController, in the guide --- railties/guides/source/getting_started.textile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 81e8a68835..8e3fa92c65 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -171,12 +171,12 @@ A view's purpose is to display this information in a human readable format. An i To create a new controller, run this command: -$ rails generate controller home index +$ rails generate controller welcome index -Rails will create several files for you. Most important of these are of course the controller, located at +app/controllers/home_controller.rb+ and the view, located at +app/views/home/index.html.erb+. +Rails will create several files for you. Most important of these are of course the controller, located at +app/controllers/welcome_controller.rb+ and the view, located at +app/views/welcome/index.html.erb+. -Open the +app/views/home/index/html.erb+ file in your text editor and edit it to contain a single line of code: +Open the +app/views/welcome/index/html.erb+ file in your text editor and edit it to contain a single line of code:

Hello, Rails!

@@ -317,7 +317,7 @@ invoking the command: rake db:migrate RAILS_ENV=production. h4. Adding a Link To hook the posts up to the home page you've already created, you can add a link -to the home page. Open +app/views/home/index.html.erb+ and modify it as follows: +to the home page. Open +app/views/welcome/index.html.erb+ and modify it as follows:

Hello, Rails!

@@ -904,7 +904,7 @@ Associations":association_basics.html guide. h4. Adding a Route for Comments -As with the +home+ controller, we will need to add a route so that Rails knows +As with the +welcome+ controller, we will need to add a route so that Rails knows where we would like to navigate to see +comments+. Open up the +config/routes.rb+ file again. Near the top, you will see the entry for +posts+ that was added automatically by the scaffold generator: resources -- cgit v1.2.3