diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2012-03-14 14:33:16 -0700 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2012-03-14 14:33:16 -0700 |
commit | 35e0cb51f839974fa95c569d016f7141f78dcee6 (patch) | |
tree | 7f22f61adb1af2f29b959b360061d250fa2b335f | |
parent | 66e5e7136d2e9ddeba790268e4cf019f3814436f (diff) | |
download | rails-35e0cb51f839974fa95c569d016f7141f78dcee6.tar.gz rails-35e0cb51f839974fa95c569d016f7141f78dcee6.tar.bz2 rails-35e0cb51f839974fa95c569d016f7141f78dcee6.zip |
[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
-rw-r--r-- | railties/guides/source/getting_started.textile | 10 |
1 files 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: <shell> -$ rails generate controller home index +$ rails generate controller welcome index </shell> -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: <code class="html"> <h1>Hello, Rails!</h1> @@ -317,7 +317,7 @@ invoking the command: <tt>rake db:migrate RAILS_ENV=production</tt>. 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: <ruby> <h1>Hello, Rails!</h1> @@ -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: <tt>resources |