pg 121 GENERATE Story model:
\shovell>ruby script/generate model Story name:string link:string
pg 125 EDIT: test\fixtures\[03-]stories.yml *
pg 129 EDIT: db\migrate\[05-]001_create_stories.rb *
~In my installation the migration file is YYYYMMDDhhmmss_create_stories.rb
pg 131 MIGRATE:
\shovell>rake db:migrate
pg 133 CREATE records:
\shovell>ruby script/console
pg 135 VERIFY record entry:
>> Story.find(:all)
pg 138 ~I recommend that you do Not delete record
pg 140 GENERATE Stories controller:
\shovell>ruby script/generate controller Stories index
pg 143 VERIFY controllers and views are working correctly:
\shovell>ruby script/server
open browser to:
http://localhost:3000/stories
pg 146 ~I recommend that you do Not generate scaffolding, quote "experiment with this
approach in your own projects"
~I recommend trying the "Step by Step" tutorial instead.
pg 149 EDIT: app\views\stories\[08-]index.html.erb
pg 150 EDIT: app\controllers\[09-]stories_controller.rb
EDIT: app\views\stories\[10-]index.html.erb
pg 151 quote "In case you deleted all of your model records when we experimented
with scaffolding earlier, make sure you create at least one story."
EDIT: app\controllers\[11-]stories_controller.rb *
EDIT: app\views\stories\[12-]index.html.erb *
VERIFY:
\shovell>ruby script/server
open browser to:
http://localhost:3000/stories
pg 152 EDIT: app\views\stories\[13-]index.html.erb *
EDIT: app\controllers\[16-]stories_controller.rb *
VERIFY:
\shovell>ruby script/server
open browser to:
http://localhost:3000/stories
Bookmarks