From 962c55de0d24561d54babe5608630f93afc2681f Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:16:58 -0700
Subject: Add Tip about skipping to Section 3 if they want to come back to the
 philosophy later

---
 railties/guides/source/getting_started.textile | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index bf6104b96b..ce556a0f87 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -46,6 +46,10 @@ in rails/railties/guides/code/getting_started.
 
 h3. What is Rails?
 
+TIP: This section goes into the background and philosophy of the Rails framework
+in detail. You can safely skip this section and come back to it at a later time.
+Section 3 starts you on the path to creating your first Rails application.
+
 Rails is a web application development framework written in the Ruby language.
 It is designed to make programming web applications easier by making assumptions
 about what every developer needs to get started. It allows you to write less
-- 
cgit v1.2.3


From ee100128c3a917f96d6f40293bb5a5ed3bcf8c27 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:18:24 -0700
Subject: Move paragraphs to flow better

- Give the user a way to know they are fully installed and ready to continue
---
 railties/guides/source/getting_started.textile | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index ce556a0f87..447b8e86d0 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -219,7 +219,12 @@ Ian Robinson
 
 h3. Creating a New Rails Project
 
-If you follow this guide, you'll create a Rails project called <tt>blog</tt>, a
+The best way to use this guide is to follow each step as it happens, no code or
+step needed to make this example application has been left out, so you can
+literally follow along step by step. If you need to see the completed code, you
+can download it from "Getting Started Code":https://github.com/mikel/getting-started-code.
+
+By following along with this guide, you'll create a Rails project called <tt>blog</tt>, a
 (very) simple weblog. Before you can start building the application, you need to
 make sure that you have Rails itself installed.
 
@@ -237,13 +242,16 @@ Usually run this as the root user:
 TIP. If you're working on Windows, you can quickly install Ruby and Rails with
 "Rails Installer":http://railsinstaller.org.
 
-h4. Creating the Blog Application
+To verify that you have everything installed correctly, you should be able to run
+the following:
 
-The best way to use this guide is to follow each step as it happens, no code or
-step needed to make this example application has been left out, so you can
-literally follow along step by step. If you need to see the completed code, you
-can download it from "Getting Started
-Code":https://github.com/mikel/getting-started-code.
+<shell>
+# rails --version
+</shell>
+
+If it says something like "Rails 3.1.1" you are ready to continue.
+
+h4. Creating the Blog Application
 
 To begin, open a terminal, navigate to a folder where you have rights to create
 files, and type:
-- 
cgit v1.2.3


From 6ac65c92029d3eefd101f9458d86bae0314cd14c Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:19:21 -0700
Subject: Use rails help new instead of rails new -h

---
 railties/guides/source/getting_started.textile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 447b8e86d0..b9a0f6a8ba 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -263,8 +263,7 @@ $ rails new blog
 This will create a Rails application called Blog in a directory called blog.
 
 TIP: You can see all of the switches that the Rails application builder accepts
-by running
-<tt>rails new -h</tt>.
+by running <tt>rails help new</tt>.
 
 After you create the blog application, switch to its folder to continue work
 directly in that application:
-- 
cgit v1.2.3


From b778a7eefbf755f5f131b5af06a4c555628075a9 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:21:40 -0700
Subject: Updated wording on what 'rails new blog' did for the user

- Alphabetized the files/folders created
- Added link to Configuring Rails Applications
---
 railties/guides/source/getting_started.textile | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index b9a0f6a8ba..dfd27459b4 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -272,28 +272,28 @@ directly in that application:
 $ cd blog
 </shell>
 
-In any case, Rails will create a folder in your working directory called
-<tt>blog</tt>. Open up that folder and explore its contents. Most of the work in
+The 'rails new blog' command we ran above created a folder in your working directory 
+called <tt>blog</tt>. The <tt>blog</tt> folder has a number of auto-generated folders
+that make up the structure of a Rails application. Most of the work in
 this tutorial will happen in the <tt>app/</tt> folder, but here's a basic
-rundown on the function of each folder that Rails creates in a new application
-by default:
+rundown on the function of each of the files and folders that Rails created by default:
 
 |_.File/Folder|_.Purpose|
-|Gemfile|This file allows you to specify what gem dependencies are needed for your Rails application. See section on Bundler, below.|
-|README|This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on.|
-|Rakefile|This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application.|
 |app/|Contains the controllers, models, views and assets for your application. You'll focus on this folder for the remainder of this guide.|
-|config/|Configure your application's runtime rules, routes, database, and more.|
+|config/|Configure your application's runtime rules, routes, database, and more.  This is covered in more detail in "Configuring Rails Applications":configuring.html|
 |config.ru|Rack configuration for Rack based servers used to start the application.|
-|db/|Shows your current database schema, as well as the database migrations. You'll learn about migrations shortly.|
+|db/|Contains your current database schema, as well as the database migrations.|
 |doc/|In-depth documentation for your application.|
-|lib/|Extended modules for your application (not covered in this guide).|
+|Gemfile<BR />Gemfile.lock|These files allow you to specify what gem dependencies are needed for your Rails application.|
+|lib/|Extended modules for your application.|
 |log/|Application log files.|
 |public/|The only folder seen to the world as-is. Contains the static files and compiled assets.|
+|Rakefile|This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application.|
+|README|This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on.|
 |script/|Contains the rails script that starts your app and can contain other scripts you use to deploy or run your application.|
 |test/|Unit tests, fixtures, and other test apparatus. These are covered in "Testing Rails Applications":testing.html|
 |tmp/|Temporary files|
-|vendor/|A place for all third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you install it into your project) and plugins containing additional prepackaged functionality.|
+|vendor/|A place for all third-party code. In a typical Rails application, this includes Ruby Gems, the Rails source code (if you optionally install it into your project) and plugins containing additional prepackaged functionality.|
 
 h4. Configuring a Database
 
-- 
cgit v1.2.3


From 194a42e7aa7d1812257b14eabdd30c35f45bc8ed Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:24:44 -0700
Subject: Updated wording to read better

---
 railties/guides/source/getting_started.textile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index dfd27459b4..86fcb226d5 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -300,11 +300,12 @@ h4. Configuring a Database
 Just about every Rails application will interact with a database. The database
 to use is specified in a configuration file, +config/database.yml+.  If you open
 this file in a new Rails application, you'll see a default database
-configuration using SQLite3. The file contains sections for three different
+configured to use SQLite3. The file contains sections for three different
 environments in which Rails can run by default:
 
-* The +development+ environment is used on your development computer as you interact manually with the application.
-* The +test+ environment is used to run automated tests.
+* The +development+ environment is used on your development/local computer as you interact 
+manually with the application.
+* The +test+ environment is used when running automated tests.
 * The +production+ environment is used when you deploy your application for the world to use.
 
 h5. Configuring an SQLite3 Database
-- 
cgit v1.2.3


From 4bf057b8661754948681a18cf17ff5676518d774 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:25:45 -0700
Subject: Move Tip up higher so users who are fine with SQLite can skip to the
 next section

---
 railties/guides/source/getting_started.textile | 34 ++++++++++++++------------
 1 file changed, 18 insertions(+), 16 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 86fcb226d5..63afc5898f 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -334,7 +334,17 @@ and PostgreSQL "out of the box", and has plugins for many database systems. If
 you are using a database in a production environment Rails most likely has an
 adapter for it.
 
-h5. Configuring a MySQL Database
+h5. Other database configuration options
+
+TIP: You don't have to update the database configurations manually. If you look at the
+options of the application generator, you will see that one of the options
+is named <tt>--database</tt>. This option allows you to choose an adapter from a
+list of the most used relational databases. You can even run the generator
+repeatedly: <tt>cd .. && rails new blog --database=mysql</tt>. When you confirm the overwriting
+ of the +config/database.yml+ file, your application will be configured for MySQL
+instead of SQLite.
+
+h6. Configuring a MySQL Database
 
 If you choose to use MySQL instead of the shipped SQLite3 database, your
 +config/database.yml+ will look a little different. Here's the development
@@ -355,7 +365,7 @@ If your development computer's MySQL installation includes a root user with an
 empty password, this configuration should work for you. Otherwise, change the
 username and password in the +development+ section as appropriate.
 
-h5. Configuring a PostgreSQL Database
+h6. Configuring a PostgreSQL Database
 
 If you choose to use PostgreSQL, your +config/database.yml+ will be customized
 to use PostgreSQL databases:
@@ -370,9 +380,9 @@ development:
   password:
 </yaml>
 
-h5. Configuring an SQLite3 Database for JRuby Platform
+h6. Configuring an SQLite3 Database for JRuby Platform
 
-If you choose to use SQLite3 and are using JRuby, your +config/database.yml+ will
+If you choose to use SQLite3 and using JRuby, your +config/database.yml+ will
 look a little different. Here's the development section:
 
 <yaml>
@@ -381,9 +391,9 @@ development:
   database: db/development.sqlite3
 </yaml>
 
-h5. Configuring a MySQL Database for JRuby Platform
+h6. Configuring a MySQL Database for JRuby Platform
 
-If you choose to use MySQL and are using JRuby, your +config/database.yml+ will look
+If you choose to use MySQL and using JRuby, your +config/database.yml+ will look
 a little different. Here's the development section:
 
 <yaml>
@@ -394,9 +404,9 @@ development:
   password:
 </yaml>
 
-h5. Configuring a PostgreSQL Database for JRuby Platform
+h6. Configuring a PostgreSQL Database for JRuby Platform
 
-Finally if you choose to use PostgreSQL and are using JRuby, your
+Finally if you choose to use PostgreSQL and using JRuby, your
 +config/database.yml+ will look a little different. Here's the development
 section:
 
@@ -411,14 +421,6 @@ development:
 
 Change the username and password in the +development+ section as appropriate.
 
-TIP: You don't have to update the database configurations manually. If you look at the
-options of the application generator, you will see that one of the options
-is named <tt>--database</tt>. This option allows you to choose an adapter from a
-list of the most used relational databases. You can even run the generator
-repeatedly: <tt>cd .. && rails new blog --database=mysql</tt>. When you confirm the overwriting
- of the +config/database.yml+ file, your application will be configured for MySQL
-instead of SQLite.
-
 h4. Creating the Database
 
 Now that you have your database configured, it's time to have Rails create an
-- 
cgit v1.2.3


From 703d5c2033665987c2fa6eff9f39095fb6c03061 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:26:23 -0700
Subject: Fix typo

---
 railties/guides/source/getting_started.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 63afc5898f..c40c21102c 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -494,7 +494,7 @@ Open this file in your text editor and edit it to contain a single line of code:
 h4. Setting the Application Home Page
 
 Now that we have made the controller and view, we need to tell Rails when we
-want "Hello Rails" to show up. In our case, we want it to show up when we
+want "Hello Rails!" to show up. In our case, we want it to show up when we
 navigate to the root URL of our site,
 "http://localhost:3000":http://localhost:3000, instead of the "Welcome Aboard"
 smoke test.
-- 
cgit v1.2.3


From 434fbe454cb2367e74b757ba34b7035f7379ac8a Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:27:14 -0700
Subject: Update wording to flow better

---
 railties/guides/source/getting_started.textile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index c40c21102c..78cf01cdc0 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -515,8 +515,8 @@ 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:
+Find the line beginning with +root :to+, uncomment it by removing the pound sign
+at the beginning of the line.  It should look something like the following:
 
 <ruby>
 Blog::Application.routes.draw do
@@ -544,7 +544,7 @@ resource in a single operation, scaffolding is the tool for the job.
 
 h3. Creating a Resource
 
-In the case of the blog application, you can start by generating a scaffolded
+In the case of the blog application, you can start by generating a scaffold for the
 Post resource: this will represent a single blog posting. To do this, enter this
 command in your terminal:
 
-- 
cgit v1.2.3


From 094bb8e50c839be9f5ed93282ececeb4e3a15d76 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:28:09 -0700
Subject: Update order so they show up in the order they do in the scaffolding
 output

---
 railties/guides/source/getting_started.textile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 78cf01cdc0..d8e55eed60 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -558,21 +558,21 @@ folders, and edit <tt>config/routes.rb</tt>. Here's a quick overview of what it
 |_.File                                       |_.Purpose|
 |db/migrate/20100207214725_create_posts.rb    |Migration to create the posts table in your database (your name will include a different timestamp)|
 |app/models/post.rb                           |The Post model|
-|test/fixtures/posts.yml                      |Dummy posts for use in testing|
+|test/unit/post_test.rb                       |Unit testing harness for the posts model|
+|test/fixtures/posts.yml                      |Sample posts for use in testing|
+|config/routes.rb                             |Edited to include routing information for posts|
 |app/controllers/posts_controller.rb          |The Posts controller|
 |app/views/posts/index.html.erb               |A view to display an index of all posts |
 |app/views/posts/edit.html.erb                |A view to edit an existing post|
 |app/views/posts/show.html.erb                |A view to display a single post|
 |app/views/posts/new.html.erb                 |A view to create a new post|
 |app/views/posts/_form.html.erb               |A partial to control the overall look and feel of the form used in edit and new views|
-|app/helpers/posts_helper.rb                  |Helper functions to be used from the post views|
-|app/assets/stylesheets/scaffolds.css.scss    |Cascading style sheet to make the scaffolded views look better|
-|app/assets/stylesheets/posts.css.scss        |Cascading style sheet for the posts controller|
-|app/assets/javascripts/posts.js.coffee       |CoffeeScript for the posts controller|
-|test/unit/post_test.rb                       |Unit testing harness for the posts model|
 |test/functional/posts_controller_test.rb     |Functional testing harness for the posts controller|
+|app/helpers/posts_helper.rb                  |Helper functions to be used from the post views|
 |test/unit/helpers/posts_helper_test.rb       |Unit testing harness for the posts helper|
-|config/routes.rb                             |Edited to include routing information for posts|
+|app/assets/javascripts/posts.js.coffee       |CoffeeScript for the posts controller|
+|app/assets/stylesheets/posts.css.scss        |Cascading style sheet for the posts controller|
+|app/assets/stylesheets/scaffolds.css.scss    |Cascading style sheet to make the scaffolded views look better|
 
 NOTE. While scaffolding will get you up and running quickly, the code it
 generates is unlikely to be a perfect fit for your application. You'll most
-- 
cgit v1.2.3


From 06a8d16c8e0d87ab9a0dbba642aeb255f877cc8e Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:29:11 -0700
Subject: Update wording to be more explicit on what the timestamp fields track

---
 railties/guides/source/getting_started.textile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index d8e55eed60..01e0def226 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -609,12 +609,12 @@ class CreatePosts < ActiveRecord::Migration
 end
 </ruby>
 
-The above migration creates a method named +change+ which will be called when you
-run this migration. The action defined in that method is also reversible, which
+The above migration has one method named +change+ which will be called when you
+run this migration. The action defined in this method is also reversible, which
 means Rails knows how to reverse the change made by this migration, in case you
-want to reverse it at later date. By default, when you run this migration it
-creates a +posts+ table with two string columns and a text column. It also
-creates two timestamp fields to track record creation and updating. More
+want to reverse it at later date. When you run this migration it will create a 
++posts+ table with two string columns and a text column. It also creates two 
+timestamp fields to allow Rails to track post creation and update times. More
 information about Rails migrations can be found in the "Rails Database
 Migrations":migrations.html guide.
 
-- 
cgit v1.2.3


From 1394c5447a8c27ab654556595468b7a0376c0cc9 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:31:07 -0700
Subject: Update wording to read better

---
 railties/guides/source/getting_started.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 01e0def226..d4bb55b5ba 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -634,7 +634,7 @@ table.
 ==  CreatePosts: migrated (0.0020s) ===========================================
 </shell>
 
-NOTE. Because by default you're working in the development environment, this
+NOTE. Because you're working in the development environment by default, this
 command will apply to the database defined in the +development+ section of your
 +config/database.yml+ file. If you would like to execute migrations in another
 environment, for instance in production, you must explicitly pass it when
-- 
cgit v1.2.3


From fc8f0a85b5c6869aed3f8d05b15c6b014deb054f Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:31:33 -0700
Subject: Add link to AR Validations and Callbacks to further explain
 validations

---
 railties/guides/source/getting_started.textile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index d4bb55b5ba..1f1976393f 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -705,7 +705,8 @@ end
 These changes will ensure that all posts have a name and a title, and that the
 title is at least five characters long. Rails can validate a variety of
 conditions in a model, including the presence or uniqueness of columns, their
-format, and the existence of associated objects.
+format, and the existence of associated objects.  Validations are covered in detail
+in "Active Record Validations and Callbacks":active_record_validations_callbacks.html#validations-overview
 
 h4. Using the Console
 
-- 
cgit v1.2.3


From cb552f807e5bb2650791d17b01b6ac67c6023937 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:32:26 -0700
Subject: p.errors.full_messages is a little more human readable

---
 railties/guides/source/getting_started.textile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 1f1976393f..e88d0a7629 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -731,10 +731,8 @@ After the console loads, you can use it to work with your application's models:
      updated_at: nil>
 >> p.save
 => false
->> p.errors
-=> #<OrderedHash { :title=>["can't be blank",
-                           "is too short (minimum is 5 characters)"],
-                   :name=>["can't be blank"] }>
+>> p.errors.full_messages
+=> ["Name can't be blank", "Title can't be blank", "Title is too short (minimum is 5 characters)"]
 </shell>
 
 This code shows creating a new +Post+ instance, attempting to save it and
-- 
cgit v1.2.3


From 9b96f7414e7380266ed5ccf582f55f1e10ba877b Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:33:29 -0700
Subject: Be explicit about changing code

---
 railties/guides/source/getting_started.textile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index e88d0a7629..1d03698f4a 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -742,8 +742,8 @@ inspecting the +errors+ of the post.
 When you're finished, type +exit+ and hit +return+ to exit the console.
 
 TIP: Unlike the development web server, the console does not automatically load
-your code afresh for each line. If you make changes to your models while the
-console is open, type +reload!+ at the console prompt to load them.
+your code afresh for each line. If you make changes to your models (in your editor)
+while the console is open, type +reload!+ at the console prompt to load them.
 
 h4. Listing All Posts
 
-- 
cgit v1.2.3


From 3e3872b5985f0b360571b97cdc1b3203989d40fd Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:35:08 -0700
Subject: Make the guide more friendly

- Changed Rails 3.0 to 3.0+
---
 railties/guides/source/getting_started.textile | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 1d03698f4a..bd929a6ae2 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -747,8 +747,9 @@ while the console is open, type +reload!+ at the console prompt to load them.
 
 h4. Listing All Posts
 
-The easiest place to start looking at functionality is with the code that lists
-all posts. Open the file +app/controllers/posts_controller.rb+ and look at the
+Let's dive into the Rails code a little deeper to see how the application is
+showing us the list of Posts. Open the file 
++app/controllers/posts_controller.rb+ and look at the
 +index+ action:
 
 <ruby>
@@ -762,9 +763,9 @@ def index
 end
 </ruby>
 
-+Post.all+ calls the +Post+ model to return all of the posts currently in the
-database. The result of this call is an array of posts that we store in an
-instance variable called +@posts+.
++Post.all+ calls the all method on the +Post+ model, which returns all of 
+the posts currently in the database. The result of this call is an array 
+of Post records that we store in an instance variable called +@posts+.
 
 TIP: For more information on finding records with Active Record, see "Active
 Record Query Interface":active_record_querying.html.
@@ -815,7 +816,7 @@ and links. A few things to note in the view:
 
 NOTE. In previous versions of Rails, you had to use +&lt;%=h post.name %&gt;+ so
 that any HTML would be escaped before being inserted into the page. In Rails
-3.0, this is now the default. To get unescaped HTML, you now use +&lt;%= raw
+3.0+, this is now the default. To get unescaped HTML, you now use +&lt;%= raw
 post.name %&gt;+.
 
 TIP: For more details on the rendering process, see "Layouts and Rendering in
@@ -829,9 +830,10 @@ Rails renders a view to the browser, it does so by putting the view's HTML into
 a layout's HTML. In previous versions of Rails, the +rails generate scaffold+
 command would automatically create a controller specific layout, like
 +app/views/layouts/posts.html.erb+, for the posts controller. However this has
-been changed in Rails 3.0. An application specific +layout+ is used for all the
+been changed in Rails 3.0+. An application specific +layout+ is used for all the
 controllers and can be found in +app/views/layouts/application.html.erb+. Open
-this layout in your editor and modify the +body+ tag:
+this layout in your editor and modify the +body+ tag to include the style directive
+below:
 
 <erb>
 <!DOCTYPE html>
-- 
cgit v1.2.3


From 5e83491e976c867c57892d1542dbbcf571bada41 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 01:40:28 -0700
Subject: Be explicit on where the show.html.erb is located

---
 railties/guides/source/getting_started.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index bd929a6ae2..8f48c52442 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -1011,7 +1011,7 @@ end
 
 The +show+ action uses +Post.find+ to search for a single record in the database
 by its id value. After finding the record, Rails displays it by using
-+show.html.erb+:
++app/views/posts/show.html.erb+:
 
 <erb>
 <p class="notice"><%= notice %></p>
-- 
cgit v1.2.3


From c0ee497436718ae6be50cfef5ee83473f1070fcd Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 03:12:13 -0700
Subject: Grammar change

---
 railties/guides/source/getting_started.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 8f48c52442..d0ba07a82d 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -1116,7 +1116,7 @@ the controller.
 
 h3. Adding a Second Model
 
-Now that you've seen how a model built with scaffolding looks like, it's time to
+Now that you've seen what a model built with scaffolding looks like, it's time to
 add a second model to the application. The second model will handle comments on
 blog posts.
 
-- 
cgit v1.2.3


From 0774f22941f6846acd79a07d43cd417cd09a1998 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 03:13:58 -0700
Subject: Convert tables to table format

---
 railties/guides/source/getting_started.textile | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index d0ba07a82d..f387dddce8 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -1135,9 +1135,11 @@ $ rails generate model Comment commenter:string body:text post:references
 
 This command will generate four files:
 
-* +app/models/comment.rb+ - The model.
-* +db/migrate/20100207235629_create_comments.rb+ - The migration.
-* +test/unit/comment_test.rb+ and +test/fixtures/comments.yml+ - The test harness.
+|_.File                                       |_.Purpose|
+|db/migrate/20100207235629_create_comments.rb | Migration to create the comments table in your database (your name will include a different timestamp) |
+| app/models/comment.rb                       | The Comment model |
+| test/unit/comment_test.rb                   | Unit testing harness for the comments model |
+| test/fixtures/comments.yml                  | Sample comments for use in testing |
 
 First, take a look at +comment.rb+:
 
@@ -1258,13 +1260,14 @@ $ rails generate controller Comments
 
 This creates six files and one empty directory:
 
-* +app/controllers/comments_controller.rb+ - The controller.
-* +app/helpers/comments_helper.rb+ - A view helper file.
-* +test/functional/comments_controller_test.rb+ - The functional tests for the controller.
-* +test/unit/helpers/comments_helper_test.rb+ - The unit tests for the helper.
-* +app/views/comments/+ - Views of the controller are stored here.
-* +app/assets/stylesheets/comment.css.scss+ - Cascading style sheet for the controller.
-* +app/assets/javascripts/comment.js.coffee+ - CoffeeScript for the controller.
+|_.File/Directory                             |_.Purpose                                 |
+| app/controllers/comments_controller.rb      | The Comments controller                  |
+| app/views/comments/                         | Views of the controller are stored here  |
+| test/functional/comments_controller_test.rb | The functional tests for the controller  |
+| app/helpers/comments_helper.rb              | A view helper file                       |
+| test/unit/helpers/comments_helper_test.rb   | The unit tests for the helper            |
+| app/assets/javascripts/comment.js.coffee    | CoffeeScript for the controller          |
+| app/assets/stylesheets/comment.css.scss     | Cascading style sheet for the controller |
 
 Like with any blog, our readers will create their comments directly after
 reading the post, and once they have added their comment, will be sent back to
-- 
cgit v1.2.3


From a3156ac0f2d57ca5a57c035530ff5b49f81716f3 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 03:15:22 -0700
Subject: Add output for add_index command

---
 railties/guides/source/getting_started.textile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index f387dddce8..8faacdd03e 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -1186,8 +1186,10 @@ run against the current database, so in this case you will just see:
 <shell>
 ==  CreateComments: migrating =================================================
 -- create_table(:comments)
-   -> 0.0017s
-==  CreateComments: migrated (0.0018s) ========================================
+   -> 0.0008s
+-- add_index(:comments, :post_id)
+   -> 0.0003s
+==  CreateComments: migrated (0.0012s) ========================================
 </shell>
 
 h4. Associating Models
-- 
cgit v1.2.3


From 50a9de514f8724b04d3681aa9ca228a8ca490909 Mon Sep 17 00:00:00 2001
From: Jason Noble <github+jasonn@jasonnoble.org>
Date: Sun, 13 Nov 2011 03:15:56 -0700
Subject: Update guide to use Ruby 1.9 hash syntax

---
 railties/guides/source/getting_started.textile | 88 +++++++++++++-------------
 1 file changed, 43 insertions(+), 45 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 8faacdd03e..8f34e87e9a 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -524,10 +524,10 @@ Blog::Application.routes.draw do
   #...
   # You can have the root of your site routed with "root"
   # just remember to delete public/index.html.
-  root :to => "home#index"
+  root to: "home#index"
 </ruby>
 
-The +root :to => "home#index"+ tells Rails to map the root action to the home
+The +root to: "home#index"+ tells Rails to map the root action to the home
 controller's index action.
 
 Now if you navigate to "http://localhost:3000":http://localhost:3000 in your
@@ -696,9 +696,9 @@ Open the +app/models/post.rb+ file and edit it:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name,  :presence => true
-  validates :title, :presence => true,
-                    :length => { :minimum => 5 }
+  validates :name,  presence: true
+  validates :title, presence: true,
+                    length: { minimum: 5 }
 end
 </ruby>
 
@@ -725,7 +725,7 @@ open a console that will roll back any changes you make by using <tt>rails conso
 After the console loads, you can use it to work with your application's models:
 
 <shell>
->> p = Post.new(:content => "A new post")
+>> p = Post.new(content: "A new post")
 => #<Post id: nil, name: nil, title: nil,
      content: "A new post", created_at: nil,
      updated_at: nil>
@@ -758,11 +758,15 @@ def index
 
   respond_to do |format|
     format.html  # index.html.erb
-    format.json  { render :json => @posts }
+    format.json  { render json: @posts }
   end
 end
 </ruby>
 
+TIP: This Guide was written using Ruby 1.9.2.  If you are using Ruby 1.8.7, some of
+the syntax may look slightly different.  For example, the hash syntax changed from
+render :json => @posts (1.8.7) to render json: @posts (1.9.2).
+
 +Post.all+ calls the all method on the +Post+ model, which returns all of 
 the posts currently in the database. The result of this call is an array 
 of Post records that we store in an instance variable called +@posts+.
@@ -797,8 +801,7 @@ Here's +app/views/posts/index.html.erb+:
     <td><%= post.content %></td>
     <td><%= link_to 'Show', post %></td>
     <td><%= link_to 'Edit', edit_post_path(post) %></td>
-    <td><%= link_to 'Destroy', post, :confirm => 'Are you sure?',
-                                     :method => :delete %></td>
+    <td><%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %></td>
   </tr>
 <% end %>
 </table>
@@ -866,7 +869,7 @@ def new
 
   respond_to do |format|
     format.html  # new.html.erb
-    format.json  { render :json => @post }
+    format.json  { render json: @post }
   end
 end
 </ruby>
@@ -958,14 +961,11 @@ def create
 
   respond_to do |format|
     if @post.save
-      format.html  { redirect_to(@post,
-                    :notice => 'Post was successfully created.') }
-      format.json  { render :json => @post,
-                    :status => :created, :location => @post }
+      format.html { redirect_to @post, notice: 'Post was successfully created.' }
+      format.json { render json: @post, status: :created, location: @post }
     else
-      format.html  { render :action => "new" }
-      format.json  { render :json => @post.errors,
-                    :status => :unprocessable_entity }
+      format.html { render action: "new" }
+      format.json { render json: @post.errors, status: :unprocessable_entity }
     end
   end
 end
@@ -1003,8 +1003,8 @@ def show
   @post = Post.find(params[:id])
 
   respond_to do |format|
-    format.html  # show.html.erb
-    format.json  { render :json => @post }
+    format.html # show.html.erb
+    format.json { render json: @post }
   end
 end
 </ruby>
@@ -1073,13 +1073,11 @@ def update
 
   respond_to do |format|
     if @post.update_attributes(params[:post])
-      format.html  { redirect_to(@post,
-                    :notice => 'Post was successfully updated.') }
-      format.json  { render :json => {}, :status => :ok }
+      format.html { redirect_to @post, notice: 'Post was successfully updated.' }
+      format.json { head :ok }
     else
-      format.html  { render :action => "edit" }
-      format.json  { render :json => @post.errors,
-                    :status => :unprocessable_entity }
+      format.html { render action: "edit" }
+      format.json { render json: @post.errors, status: :unprocessable_entity }
     end
   end
 end
@@ -1215,9 +1213,9 @@ You'll need to edit the +post.rb+ file to add the other side of the association:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name,  :presence => true
-  validates :title, :presence => true,
-                    :length => { :minimum => 5 }
+  validates :name,  presence: true
+  validates :title, presence: true,
+                    length: { :minimum: 5 }
 
   has_many :comments
 end
@@ -1559,8 +1557,8 @@ So first, let's add the delete link in the
 
 <p>
   <%= link_to 'Destroy Comment', [comment.post, comment],
-               :confirm => 'Are you sure?',
-               :method => :delete %>
+               confirm: 'Are you sure?',
+               method: :delete %>
 </p>
 </erb>
 
@@ -1602,10 +1600,10 @@ model, +app/models/post.rb+, as follows:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name,  :presence => true
-  validates :title, :presence => true,
-                    :length => { :minimum => 5 }
-  has_many :comments, :dependent => :destroy
+  validates :name, presence: true
+  validates :title, presence: true,
+            length: {minimum: 5}
+  has_many :comments, dependent: :destroy
 end
 </ruby>
 
@@ -1629,7 +1627,7 @@ action, except for +index+ and +show+, so we write that:
 <ruby>
 class PostsController < ApplicationController
 
-  http_basic_authenticate_with :name => "dhh", :password => "secret", :except => [:index, :show]
+  http_basic_authenticate_with name: "dhh", password: "secret", except: [:index, :show]
 
   # GET /posts
   # GET /posts.json
@@ -1645,7 +1643,7 @@ We also only want to allow authenticated users to delete comments, so in the
 <ruby>
 class CommentsController < ApplicationController
 
-  http_basic_authenticate_with :name => "dhh", :password => "secret", :only => :destroy
+  http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy
 
   def create
     @post = Post.find(params[:post_id])
@@ -1683,15 +1681,14 @@ edit tags via posts:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name,  :presence => true
-  validates :title, :presence => true,
-                    :length => { :minimum => 5 }
-
-  has_many :comments, :dependent => :destroy
+  validates :name, presence: true
+  validates :title, presence: true,
+            length: {minimum: 5}
+  has_many :comments, dependent: :destroy
   has_many :tags
 
-  accepts_nested_attributes_for :tags, :allow_destroy => :true,
-    :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
+  accepts_nested_attributes_for :tags, allow_destroy: :true,
+    reject_if: proc { |attrs| attrs.all? { |k, v| v.blank? } }
 end
 </ruby>
 
@@ -1729,8 +1726,9 @@ We will modify +views/posts/_form.html.erb+ to render a partial to make a tag:
     <%= post_form.text_area :content %>
   </div>
   <h2>Tags</h2>
-  <%= render :partial => 'tags/form',
-             :locals => {:form => post_form} %>
+  <%= render partial: 'tags/form',
+             locals: {form: post_form} %>
+
   <div class="actions">
     <%= post_form.submit %>
   </div>
-- 
cgit v1.2.3


From e1099eb4fdb64b82485843a569ecd5006aa3dad8 Mon Sep 17 00:00:00 2001
From: Vijay Dev <vijaydev.cse@gmail.com>
Date: Sun, 13 Nov 2011 21:50:18 +0530
Subject: Revert "Update guide to use Ruby 1.9 hash syntax"

This reverts commit 50a9de514f8724b04d3681aa9ca228a8ca490909.

Reason: Let's keep the guides at 1.8 syntax
---
 railties/guides/source/getting_started.textile | 88 +++++++++++++-------------
 1 file changed, 45 insertions(+), 43 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 8f34e87e9a..8faacdd03e 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -524,10 +524,10 @@ Blog::Application.routes.draw do
   #...
   # You can have the root of your site routed with "root"
   # just remember to delete public/index.html.
-  root to: "home#index"
+  root :to => "home#index"
 </ruby>
 
-The +root to: "home#index"+ tells Rails to map the root action to the home
+The +root :to => "home#index"+ tells Rails to map the root action to the home
 controller's index action.
 
 Now if you navigate to "http://localhost:3000":http://localhost:3000 in your
@@ -696,9 +696,9 @@ Open the +app/models/post.rb+ file and edit it:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name,  presence: true
-  validates :title, presence: true,
-                    length: { minimum: 5 }
+  validates :name,  :presence => true
+  validates :title, :presence => true,
+                    :length => { :minimum => 5 }
 end
 </ruby>
 
@@ -725,7 +725,7 @@ open a console that will roll back any changes you make by using <tt>rails conso
 After the console loads, you can use it to work with your application's models:
 
 <shell>
->> p = Post.new(content: "A new post")
+>> p = Post.new(:content => "A new post")
 => #<Post id: nil, name: nil, title: nil,
      content: "A new post", created_at: nil,
      updated_at: nil>
@@ -758,15 +758,11 @@ def index
 
   respond_to do |format|
     format.html  # index.html.erb
-    format.json  { render json: @posts }
+    format.json  { render :json => @posts }
   end
 end
 </ruby>
 
-TIP: This Guide was written using Ruby 1.9.2.  If you are using Ruby 1.8.7, some of
-the syntax may look slightly different.  For example, the hash syntax changed from
-render :json => @posts (1.8.7) to render json: @posts (1.9.2).
-
 +Post.all+ calls the all method on the +Post+ model, which returns all of 
 the posts currently in the database. The result of this call is an array 
 of Post records that we store in an instance variable called +@posts+.
@@ -801,7 +797,8 @@ Here's +app/views/posts/index.html.erb+:
     <td><%= post.content %></td>
     <td><%= link_to 'Show', post %></td>
     <td><%= link_to 'Edit', edit_post_path(post) %></td>
-    <td><%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %></td>
+    <td><%= link_to 'Destroy', post, :confirm => 'Are you sure?',
+                                     :method => :delete %></td>
   </tr>
 <% end %>
 </table>
@@ -869,7 +866,7 @@ def new
 
   respond_to do |format|
     format.html  # new.html.erb
-    format.json  { render json: @post }
+    format.json  { render :json => @post }
   end
 end
 </ruby>
@@ -961,11 +958,14 @@ def create
 
   respond_to do |format|
     if @post.save
-      format.html { redirect_to @post, notice: 'Post was successfully created.' }
-      format.json { render json: @post, status: :created, location: @post }
+      format.html  { redirect_to(@post,
+                    :notice => 'Post was successfully created.') }
+      format.json  { render :json => @post,
+                    :status => :created, :location => @post }
     else
-      format.html { render action: "new" }
-      format.json { render json: @post.errors, status: :unprocessable_entity }
+      format.html  { render :action => "new" }
+      format.json  { render :json => @post.errors,
+                    :status => :unprocessable_entity }
     end
   end
 end
@@ -1003,8 +1003,8 @@ def show
   @post = Post.find(params[:id])
 
   respond_to do |format|
-    format.html # show.html.erb
-    format.json { render json: @post }
+    format.html  # show.html.erb
+    format.json  { render :json => @post }
   end
 end
 </ruby>
@@ -1073,11 +1073,13 @@ def update
 
   respond_to do |format|
     if @post.update_attributes(params[:post])
-      format.html { redirect_to @post, notice: 'Post was successfully updated.' }
-      format.json { head :ok }
+      format.html  { redirect_to(@post,
+                    :notice => 'Post was successfully updated.') }
+      format.json  { render :json => {}, :status => :ok }
     else
-      format.html { render action: "edit" }
-      format.json { render json: @post.errors, status: :unprocessable_entity }
+      format.html  { render :action => "edit" }
+      format.json  { render :json => @post.errors,
+                    :status => :unprocessable_entity }
     end
   end
 end
@@ -1213,9 +1215,9 @@ You'll need to edit the +post.rb+ file to add the other side of the association:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name,  presence: true
-  validates :title, presence: true,
-                    length: { :minimum: 5 }
+  validates :name,  :presence => true
+  validates :title, :presence => true,
+                    :length => { :minimum => 5 }
 
   has_many :comments
 end
@@ -1557,8 +1559,8 @@ So first, let's add the delete link in the
 
 <p>
   <%= link_to 'Destroy Comment', [comment.post, comment],
-               confirm: 'Are you sure?',
-               method: :delete %>
+               :confirm => 'Are you sure?',
+               :method => :delete %>
 </p>
 </erb>
 
@@ -1600,10 +1602,10 @@ model, +app/models/post.rb+, as follows:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name, presence: true
-  validates :title, presence: true,
-            length: {minimum: 5}
-  has_many :comments, dependent: :destroy
+  validates :name,  :presence => true
+  validates :title, :presence => true,
+                    :length => { :minimum => 5 }
+  has_many :comments, :dependent => :destroy
 end
 </ruby>
 
@@ -1627,7 +1629,7 @@ action, except for +index+ and +show+, so we write that:
 <ruby>
 class PostsController < ApplicationController
 
-  http_basic_authenticate_with name: "dhh", password: "secret", except: [:index, :show]
+  http_basic_authenticate_with :name => "dhh", :password => "secret", :except => [:index, :show]
 
   # GET /posts
   # GET /posts.json
@@ -1643,7 +1645,7 @@ We also only want to allow authenticated users to delete comments, so in the
 <ruby>
 class CommentsController < ApplicationController
 
-  http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy
+  http_basic_authenticate_with :name => "dhh", :password => "secret", :only => :destroy
 
   def create
     @post = Post.find(params[:post_id])
@@ -1681,14 +1683,15 @@ edit tags via posts:
 
 <ruby>
 class Post < ActiveRecord::Base
-  validates :name, presence: true
-  validates :title, presence: true,
-            length: {minimum: 5}
-  has_many :comments, dependent: :destroy
+  validates :name,  :presence => true
+  validates :title, :presence => true,
+                    :length => { :minimum => 5 }
+
+  has_many :comments, :dependent => :destroy
   has_many :tags
 
-  accepts_nested_attributes_for :tags, allow_destroy: :true,
-    reject_if: proc { |attrs| attrs.all? { |k, v| v.blank? } }
+  accepts_nested_attributes_for :tags, :allow_destroy => :true,
+    :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
 end
 </ruby>
 
@@ -1726,9 +1729,8 @@ We will modify +views/posts/_form.html.erb+ to render a partial to make a tag:
     <%= post_form.text_area :content %>
   </div>
   <h2>Tags</h2>
-  <%= render partial: 'tags/form',
-             locals: {form: post_form} %>
-
+  <%= render :partial => 'tags/form',
+             :locals => {:form => post_form} %>
   <div class="actions">
     <%= post_form.submit %>
   </div>
-- 
cgit v1.2.3


From c8c08bd000c00817d2f17f560f392965fd82229b Mon Sep 17 00:00:00 2001
From: Vijay Dev <vijaydev.cse@gmail.com>
Date: Sun, 13 Nov 2011 21:57:39 +0530
Subject: Revert "Use rails help new instead of rails new -h"

This reverts commit 6ac65c92029d3eefd101f9458d86bae0314cd14c.
---
 railties/guides/source/getting_started.textile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 8faacdd03e..98e7c93dc7 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -263,7 +263,8 @@ $ rails new blog
 This will create a Rails application called Blog in a directory called blog.
 
 TIP: You can see all of the switches that the Rails application builder accepts
-by running <tt>rails help new</tt>.
+by running
+<tt>rails new -h</tt>.
 
 After you create the blog application, switch to its folder to continue work
 directly in that application:
-- 
cgit v1.2.3


From af51409de433f14d251f7f229a2f651d3ddf7b1c Mon Sep 17 00:00:00 2001
From: Vijay Dev <vijaydev.cse@gmail.com>
Date: Sun, 13 Nov 2011 22:07:54 +0530
Subject: Revert "Move Tip up higher so users who are fine with SQLite can skip
 to the next section"

This reverts commit 4bf057b8661754948681a18cf17ff5676518d774.

Reason: Prefer to keep the configuration of all databases at the same
level
---
 railties/guides/source/getting_started.textile | 34 ++++++++++++--------------
 1 file changed, 16 insertions(+), 18 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 98e7c93dc7..9e774ff298 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -335,17 +335,7 @@ and PostgreSQL "out of the box", and has plugins for many database systems. If
 you are using a database in a production environment Rails most likely has an
 adapter for it.
 
-h5. Other database configuration options
-
-TIP: You don't have to update the database configurations manually. If you look at the
-options of the application generator, you will see that one of the options
-is named <tt>--database</tt>. This option allows you to choose an adapter from a
-list of the most used relational databases. You can even run the generator
-repeatedly: <tt>cd .. && rails new blog --database=mysql</tt>. When you confirm the overwriting
- of the +config/database.yml+ file, your application will be configured for MySQL
-instead of SQLite.
-
-h6. Configuring a MySQL Database
+h5. Configuring a MySQL Database
 
 If you choose to use MySQL instead of the shipped SQLite3 database, your
 +config/database.yml+ will look a little different. Here's the development
@@ -366,7 +356,7 @@ If your development computer's MySQL installation includes a root user with an
 empty password, this configuration should work for you. Otherwise, change the
 username and password in the +development+ section as appropriate.
 
-h6. Configuring a PostgreSQL Database
+h5. Configuring a PostgreSQL Database
 
 If you choose to use PostgreSQL, your +config/database.yml+ will be customized
 to use PostgreSQL databases:
@@ -381,9 +371,9 @@ development:
   password:
 </yaml>
 
-h6. Configuring an SQLite3 Database for JRuby Platform
+h5. Configuring an SQLite3 Database for JRuby Platform
 
-If you choose to use SQLite3 and using JRuby, your +config/database.yml+ will
+If you choose to use SQLite3 and are using JRuby, your +config/database.yml+ will
 look a little different. Here's the development section:
 
 <yaml>
@@ -392,9 +382,9 @@ development:
   database: db/development.sqlite3
 </yaml>
 
-h6. Configuring a MySQL Database for JRuby Platform
+h5. Configuring a MySQL Database for JRuby Platform
 
-If you choose to use MySQL and using JRuby, your +config/database.yml+ will look
+If you choose to use MySQL and are using JRuby, your +config/database.yml+ will look
 a little different. Here's the development section:
 
 <yaml>
@@ -405,9 +395,9 @@ development:
   password:
 </yaml>
 
-h6. Configuring a PostgreSQL Database for JRuby Platform
+h5. Configuring a PostgreSQL Database for JRuby Platform
 
-Finally if you choose to use PostgreSQL and using JRuby, your
+Finally if you choose to use PostgreSQL and are using JRuby, your
 +config/database.yml+ will look a little different. Here's the development
 section:
 
@@ -422,6 +412,14 @@ development:
 
 Change the username and password in the +development+ section as appropriate.
 
+TIP: You don't have to update the database configurations manually. If you look at the
+options of the application generator, you will see that one of the options
+is named <tt>--database</tt>. This option allows you to choose an adapter from a
+list of the most used relational databases. You can even run the generator
+repeatedly: <tt>cd .. && rails new blog --database=mysql</tt>. When you confirm the overwriting
+ of the +config/database.yml+ file, your application will be configured for MySQL
+instead of SQLite.
+
 h4. Creating the Database
 
 Now that you have your database configured, it's time to have Rails create an
-- 
cgit v1.2.3


From 30122307a1fe6645d6a75dedceca40a440f2f969 Mon Sep 17 00:00:00 2001
From: Vijay Dev <vijaydev.cse@gmail.com>
Date: Sun, 13 Nov 2011 22:27:44 +0530
Subject: copy edits in getting started guide

---
 railties/guides/source/getting_started.textile | 27 ++++++++++++--------------
 1 file changed, 12 insertions(+), 15 deletions(-)

(limited to 'railties/guides/source/getting_started.textile')

diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 9e774ff298..5f370615ca 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -221,8 +221,7 @@ h3. Creating a New Rails Project
 
 The best way to use this guide is to follow each step as it happens, no code or
 step needed to make this example application has been left out, so you can
-literally follow along step by step. If you need to see the completed code, you
-can download it from "Getting Started Code":https://github.com/mikel/getting-started-code.
+literally follow along step by step. You can get the complete code "here":https://github.com/lifo/docrails/tree/master/railties/guides/code/getting_started.
 
 By following along with this guide, you'll create a Rails project called <tt>blog</tt>, a
 (very) simple weblog. Before you can start building the application, you need to
@@ -246,7 +245,7 @@ To verify that you have everything installed correctly, you should be able to ru
 the following:
 
 <shell>
-# rails --version
+$ rails --version
 </shell>
 
 If it says something like "Rails 3.1.1" you are ready to continue.
@@ -273,7 +272,7 @@ directly in that application:
 $ cd blog
 </shell>
 
-The 'rails new blog' command we ran above created a folder in your working directory 
+The 'rails new blog' command we ran above created a folder in your working directory
 called <tt>blog</tt>. The <tt>blog</tt> folder has a number of auto-generated folders
 that make up the structure of a Rails application. Most of the work in
 this tutorial will happen in the <tt>app/</tt> folder, but here's a basic
@@ -304,7 +303,7 @@ this file in a new Rails application, you'll see a default database
 configured to use SQLite3. The file contains sections for three different
 environments in which Rails can run by default:
 
-* The +development+ environment is used on your development/local computer as you interact 
+* The +development+ environment is used on your development/local computer as you interact
 manually with the application.
 * The +test+ environment is used when running automated tests.
 * The +production+ environment is used when you deploy your application for the world to use.
@@ -514,8 +513,7 @@ 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 by removing the pound sign
-at the beginning of the line.  It should look something like the following:
+Find the line beginning with +root :to+ and uncomment it. It should look something like the following:
 
 <ruby>
 Blog::Application.routes.draw do
@@ -608,11 +606,11 @@ class CreatePosts < ActiveRecord::Migration
 end
 </ruby>
 
-The above migration has one method named +change+ which will be called when you
+The above migration creates a method named +change+ which will be called when you
 run this migration. The action defined in this method is also reversible, which
 means Rails knows how to reverse the change made by this migration, in case you
-want to reverse it at later date. When you run this migration it will create a 
-+posts+ table with two string columns and a text column. It also creates two 
+want to reverse it later. When you run this migration it will create a
++posts+ table with two string columns and a text column. It also creates two
 timestamp fields to allow Rails to track post creation and update times. More
 information about Rails migrations can be found in the "Rails Database
 Migrations":migrations.html guide.
@@ -704,7 +702,7 @@ end
 These changes will ensure that all posts have a name and a title, and that the
 title is at least five characters long. Rails can validate a variety of
 conditions in a model, including the presence or uniqueness of columns, their
-format, and the existence of associated objects.  Validations are covered in detail
+format, and the existence of associated objects. Validations are covered in detail
 in "Active Record Validations and Callbacks":active_record_validations_callbacks.html#validations-overview
 
 h4. Using the Console
@@ -747,7 +745,7 @@ while the console is open, type +reload!+ at the console prompt to load them.
 h4. Listing All Posts
 
 Let's dive into the Rails code a little deeper to see how the application is
-showing us the list of Posts. Open the file 
+showing us the list of Posts. Open the file
 +app/controllers/posts_controller.rb+ and look at the
 +index+ action:
 
@@ -762,9 +760,8 @@ def index
 end
 </ruby>
 
-+Post.all+ calls the all method on the +Post+ model, which returns all of 
-the posts currently in the database. The result of this call is an array 
-of Post records that we store in an instance variable called +@posts+.
++Post.all+ returns all of the posts currently in the database as an array
+of +Post+ records that we store in an instance variable called +@posts+.
 
 TIP: For more information on finding records with Active Record, see "Active
 Record Query Interface":active_record_querying.html.
-- 
cgit v1.2.3

