7.2 IterationB2:Add aPageLayout .................. 98
7.3 IterationB3:UseaHelpertoFormatthePrice . . . . . . . . . 100
7.4 IterationB4:Linking totheCart . . . . . . . . . . . . . . . . . 100
8 Task C: Cart Creation 104
8.1 Sessions ................................ 104
8.2 IterationC1:Creating aCart .................... 107
8.3 IterationC2:ASmarterCart .................... 110
8.4 IterationC3:HandlingErrors ................... 113
8.5 IterationC4:Finishing theCart . . . . . . . . . . . . . . . . . . 118
9 Task D: Add a Dash of AJAX 122
9.1 IterationD1:Moving theCart ................... 123
9.2 IterationD2:AnAJAX-BasedCart . . . . . . . . . . . . . . . . 128
9.3 IterationD3:HighlightingChanges . . . . . . . . . . . . . . . . 131
9.4 IterationD4:HideanEmptyCart . . . . . . . . . . . . . . . . . 133
9.5 IterationD5:DegradingIfJavascriptIsDisabled . . . . . . . . 137
9.6 WhatWeJustDid .......................... 138
10 Task E: Check Out! 140
10.1 IterationE1:Capturing anOrder . . . . . . . . . . . . . . . . . 140
11 Task F: Administration 155
11.1 IterationF1:AddingUsers ..................... 155
11.2 IterationF2:LoggingIn ....................... 163
11.3 IterationF3:LimitingAccess .................... 166
11.4 IterationF4:ASidebar,MoreAdministration . . . . . . . . . . 168
Report erratum
Prepared exclusively for Jordan A. Fowler
CONTENTS
12 Task G: One Last Wafer-Thin Change
174
12.1 Generating theXMLFeed ...................... 174
12.2 FinishingUp ............................. 181
13 Task T: Testing
184
13.1 TestsBakedRightIn ........................ 184
13.2 UnitTesting ofModels ....................... 185
13.3 FunctionalTesting ofControllers . . . . . . . . . . . . . . . . . 197
13.4 IntegrationTesting ofApplications . . . . . . . . . . . . . . . . 212
13.5 PerformanceTesting......................... 220
13.6 UsingMockObjects ......................... 224
Part III.The Rails Framework 227
14 Rails in Depth 228
14.1 So,Where�fsRails? .......................... 228
14.2 DirectoryStructure ......................... 228
14.3 RailsCon.guration ......................... 237
14.4 NamingConventions ........................ 240
14.5 LogginginRails ........................... 243
Agile Web Development with Rails
Start from the beginning
