aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRohit Arondekar <rohit.arondekar@gmail.com>2010-04-20 02:07:16 -0700
committerRohit Arondekar <rohit.arondekar@gmail.com>2010-04-20 02:07:16 -0700
commitadda7516e91943f940136cbfe0a0a0b89b65fb82 (patch)
tree6a446667721ea971db00e04d0a1d8d382e760a59 /railties
parent86a43ed8a1123b5fa039651781e05e077df8c637 (diff)
downloadrails-adda7516e91943f940136cbfe0a0a0b89b65fb82.tar.gz
rails-adda7516e91943f940136cbfe0a0a0b89b65fb82.tar.bz2
rails-adda7516e91943f940136cbfe0a0a0b89b65fb82.zip
minor fix and re-organized description of index action
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/getting_started.textile4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 09190f5800..c33d50d055 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -395,7 +395,7 @@ class CreatePosts < ActiveRecord::Migration
end
</ruby>
-The above migration creates two methods, +up+, called when you run this migration into the database, and +down+ in case you need to reverse the changes made by this migration at a later date. The +up+ command in this case creates a +posts+ table with two string columns and a text column. It also is creating two timestamp fields to track record creation and updating. More information about Rails migrations can be found in the "Rails Database Migrations":migrations.html guide.
+The above migration creates two methods, +up+, called when you run this migration into the database, and +down+ in case you need to reverse the changes made by this migration at a later date. The +up+ command in this case 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 information about Rails migrations can be found in the "Rails Database Migrations":migrations.html guide.
At this point, you can use a rake command to run the migration:
@@ -504,7 +504,7 @@ def index
end
</ruby>
-This code sets the +@posts+ instance variable to an array of all posts in the database. +Post.all+ calls the +Post+ model to return all of the posts that are currently in the database, with no limiting conditions.
++Post.all+ calls the +Post+ model to return all of the posts currently in the database. The result of this call is an array containing the posts which has been saved 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.