The Depot Application
23.5 Forms That Wrap Model Objects
21.2 Routing Requests
23.3 Helpers for Formatting, Linking, and Pagination
cp -vr /home/rubys/git/awdwr/data/code/e1/views/app/views/pager app/views
`/home/rubys/git/awdwr/data/code/e1/views/app/views/pager' -> `app/views/pager'
`/home/rubys/git/awdwr/data/code/e1/views/app/views/pager/user_list.erb' -> `app/views/pager/user_list.erb'
`/home/rubys/git/awdwr/data/code/e1/views/app/views/pager/user_list.html.erb' -> `app/views/pager/user_list.html.erb'
ruby script/generate model user name:string
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/user.rb
create test/unit/user_test.rb
create test/fixtures/users.yml
create db/migrate
create db/migrate/20100906131807_create_users.rb
Restart the server.
rake db:migrate
mv 20100906131807_create_users.rb 20100301000001_create_users.rb
(in /home/rubys/git/awdwr/work-239/view)
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.0019s
== CreateUsers: migrated (0.0020s) ===========================================
echo "PagerController.new.populate" | IRBRC=tmp/irbrc ruby script/console
>> PagerController.new.populate
=> 763
>>
get /pager/user_list
Name |
Adam Keys |
Andy Hunt |
Brian Marick |
Brian McCallister |
Chad Fowler |
Chris Pine |
Daniel Berger |
Dave Thomas |
David Heinemeier Hansson |
Eric Hodel |
Esther Derby |
Greg Wilson |
James Gray |
Jeffrey Fredrick |
Johanna Rothman |
Juliet Thomas |
Maik Schmidt |
Marcel Molina |
Mike Clark |
Mike Gunderloy |
Mike Mason |
Ryan Davis |
Scott Barron |
Scott Davis |
Thomas Fuchs |
ZZUser 000 |
ZZUser 001 |
ZZUser 002 |
ZZUser 003 |
ZZUser 004 |
get /pager/user_list?page=2
Name |
ZZUser 005 |
ZZUser 006 |
ZZUser 007 |
ZZUser 008 |
ZZUser 009 |
ZZUser 010 |
ZZUser 011 |
ZZUser 012 |
ZZUser 013 |
ZZUser 014 |
ZZUser 015 |
ZZUser 016 |
ZZUser 017 |
ZZUser 018 |
ZZUser 019 |
ZZUser 020 |
ZZUser 021 |
ZZUser 022 |
ZZUser 023 |
ZZUser 024 |
ZZUser 025 |
ZZUser 026 |
ZZUser 027 |
ZZUser 028 |
ZZUser 029 |
ZZUser 030 |
ZZUser 031 |
ZZUser 032 |
ZZUser 033 |
ZZUser 034 |
23.5 Forms That Wrap Model Objects
21.2 Routing Requests