- Week 10: ActiveRecord Associations Basics (Topics covered: What is an Association?, Auto-generated methods, Cardinality, Unsaved objects and association)
- Week 10 Resources
o ActiveRecord::Associations:ClassMethods API from api.rubyonrails.org
o Building Relationships Between Rails Models tutorial by Brian Leonard and Gail Chappell - 5525_rails_associations.zip (Unzip it in a directory of your choice and read lab document from
/rails_associations/index.html to proceed) (4/21/09: Downloaded) - Presentation - PDF: 1 slide per page (OR) OpenOffice file (22 pages)
- Online Lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (84 pages)
- EXERCISE #0: Start MySQL database server (p.g2) (4/21/2009: done)
- EXERCISE #1: Add one-to-many association to rubyweblog application. (p.2-28)
- (1.1) Create Comment Model class (p.3-6)
- (1.2) Migrate database (p.6-7)
- (1.3) Add association macros to the Model classes (p.8-11)
- (1.4) Modify controller (p.11-15)
- (1.5) Modify [view] templates (p.15-17)
- (1.6) Save the changes (p.17-18)
- (1.7) Refresh the browswer and perform user operation (p.19-21)
- (1.8) Observing the database tables (p.22-26)
- (1.9) Use Rails Console (p.26-28)
- EXERCISE #2: Options for has_many (p.28-46)
- (2.0) Create fresh test data using migration (p.28-33)
- (2.1) Exercise :order option (p.34-39)
- (2.2) Exercise :destroy option (p.39-46)
- EXERCISE #3: Add many-to-many association to rubyweblog application (p.46-65)
- (3.1) Create Category model class (p.46-49)
- (3.2) Create "categories_posts" table through migration (p.49-55)
- (3.3) Add many-to-many relationship between Post and Category models (p.55-58)
- (3.4) Create test data through migration (p.59-64)
- (3.5) Use Rails Console (p.64-65)
- EXERCISE #4: Add many-to-many association to rubyweblog application using through - not ready yet
- (4.1) Recreate rubyweblog_development database (p.66-68)
- (4.2) Remove migration files that are not needed (p.68-69)
- (4.3) Create a join model (p.70-73)
- (4.4) Modify Post and Category models (p.73-75)
- (4.5) Create test data through migration (p.75-79)
- (4.6) Verify that the data tables are created correctly (p.79-83)
- (4.7) Use Rails Console (p.83-84)
- Finished Exercises (4:30pm)
- Homework (p.84)
Tuesday, April 21, 2009
Week 10: Rails Passion Course
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment