Skip to content

Commit

Permalink
Added the last bit about creating a new article to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan T. Cox committed Mar 11, 2012
1 parent 8d48caf commit afac83f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -59,8 +59,8 @@ Getting Started on Windows

Module 2 - Building Your First Object
=====================================
1. Copy config/database.yml.skel to config/database.yml
2. rails generate resource Article
1. Copy config/database.yml.skel to config/database.yml with `cp config/database.yml.skel config/database.yml`
2. Run `rails generate resource Article` to generate our article resource.
3. Edit db/migrate/CreateArticle to include:

class CreateArticles < ActiveRecord::Migration
Expand All @@ -87,4 +87,7 @@ Module 2 - Building Your First Object
<% @articles.each do |article| %>
<h1><%= article.title %></h1>
<p><%= article.content %></p>
<% end %>
<% end %>
6. Fire up your rails console by typing `rails console` anywhere in the project directory.
7. Manually insert a new article into the database by typing `Article.create :title => "Test Article", :content => "Oh my god here is some test content"`. This will create and save a new Article object into your database. See all that stuff that Rails spat out? That's the SQL that ActiveRecord is running for you.
8. Go to http://localhost:3000/articles and you should now see your brand spanking new article! Huzzah!

0 comments on commit afac83f

Please sign in to comment.