You are on page 1of 1

Contents • iv

Marshaling Objects 57
Pulling It All Together 57
Ruby Idioms 58

Part II — Building an Application


5. The Depot Application . . . . . . . . . . 63
Incremental Development 63
What Depot Does 64
Let’s Code 68

6. Task A: Creating the Application . . . . . . . . 69


Iteration A1: Creating the Product Maintenance Application 69
Iteration A2: Making Prettier Listings 77

7. Task B: Validation and Unit Testing . . . . . . . 85


Iteration B1: Validating! 85
Iteration B2: Unit Testing of Models 89

8. Task C: Catalog Display . . . . . . . . . 101


Iteration C1: Creating the Catalog Listing 101
Iteration C2: Adding a Page Layout 105
Iteration C3: Using a Helper to Format the Price 107
Iteration C4: Functional Testing of Controllers 108
Iteration C5: Caching of Partial Results 111

9. Task D: Cart Creation . . . . . . . . . . 115


Iteration D1: Finding a Cart 115
Iteration D2: Connecting Products to Carts 116
Iteration D3: Adding a Button 119

10. Task E: A Smarter Cart . . . . . . . . . . 127


Iteration E1: Creating a Smarter Cart 127
Iteration E2: Handling Errors 132
Iteration E3: Finishing the Cart 137

11. Task F: Hotwiring the Storefront . . . . . . . 143


Iteration F1: Moving the Cart 144
Iteration F2: Creating a Hotwired Cart 150
Iteration F3: Highlighting Changes 155
Iteration F4: Broadcasting Updates with Action Cable 157

You might also like