Agile web development with rails: a Pragmatic guide [1 ed.] 097669400X, 9780976694007

Rails is a full-stack, open source web framework that enables you to create full-featured, sophisticated web-based appli

343 55 7MB

English Pages 554 Year 2005

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Introduction......Page 10
Rails Is Agile......Page 12
Finding Your Way Around......Page 13
Acknowledgments......Page 15
Getting Started......Page 17
Models, Views, and Controllers......Page 18
Active Record: Rails Model Support......Page 21
Action Pack: The View and Controller......Page 25
Installing on Windows......Page 28
Installing on Unix/Linux......Page 29
Rails and Databases......Page 30
Rails and ISPs......Page 33
Creating a New Application......Page 34
Hello, Rails!......Page 36
Linking Pages Together......Page 46
What We Just Did......Page 50
Building an Application......Page 51
Incremental Development......Page 52
What Depot Does......Page 53
Let's Code......Page 57
Iteration A1: Get Something Running......Page 58
Iteration A2: Add a Missing Column......Page 66
Iteration A3: Validate!......Page 68
Iteration A4: Prettier Listings......Page 72
Iteration B1: Create the Catalog Listing......Page 76
Iteration B2: Add Page Decorations......Page 79
Sessions......Page 83
More Tables, More Models......Page 85
Iteration C1: Creating a Cart......Page 87
Iteration C2: Handling Errors......Page 94
Iteration C3: Finishing the Cart......Page 99
Iteration D1: Capturing an Order......Page 104
Iteration D2: Show Cart Contents on Checkout......Page 113
Iteration E1: Basic Shipping......Page 118
Iteration F1: Adding Users......Page 127
Iteration F2: Logging In......Page 132
Iteration F3: Limiting Access......Page 134
Finishing Up......Page 138
More Icing on the Cake......Page 139
Tests Baked Right In......Page 141
Testing Models......Page 142
Testing Controllers......Page 157
Using Mock Objects......Page 170
Test-Driven Development......Page 171
Running Tests with Rake......Page 174
Performance Testing......Page 177
The Rails Framework......Page 181
Directory Structure......Page 182
Rails Configuration......Page 186
Naming Conventions......Page 189
Active Support......Page 193
Debugging Hints......Page 195
What's Next......Page 197
Active Record Basics......Page 199
Columns and Attributes......Page 200
Primary Keys and IDs......Page 206
Connecting to the Database......Page 208
CRUD---Create, Read, Update, Delete......Page 210
Relationships between Tables......Page 225
Transactions......Page 246
Acts As......Page 252
Aggregation......Page 256
Single Table Inheritance......Page 262
Validation......Page 265
Callbacks......Page 273
Advanced Attributes......Page 281
Miscellany......Page 284
Context and Dependencies......Page 287
The Basics......Page 288
Routing Requests......Page 289
Action Methods......Page 300
Cookies and Sessions......Page 309
Flash---Communicating between Actions......Page 320
Filters and Verification......Page 322
Caching, Part One......Page 327
The Problem with GET Requests......Page 333
Templates......Page 336
Builder templates......Page 338
RHTML Templates......Page 339
Helpers......Page 341
Formatting Helpers......Page 344
Linking to Other Pages and Resources......Page 346
Pagination......Page 349
Form Helpers......Page 350
Layouts and Components......Page 365
Caching, Part Two......Page 374
Adding New Templating Systems......Page 379
Introducing AJAX......Page 382
The Rails Way......Page 385
The User Interface, Revisited......Page 392
Advanced Techniques......Page 398
Sending E-mail......Page 408
Receiving E-mail......Page 415
Testing E-mail......Page 417
What AWS Is (and What It Isn't)......Page 420
The API Definition......Page 421
Dispatching Modes......Page 426
Using Alternate Dispatching......Page 429
Method Invocation Interception......Page 430
Testing Web Services......Page 432
Protocol Clients......Page 434
SQL Injection......Page 436
Cross-Site Scripting (CSS/XSS)......Page 439
Avoid Session Fixation Attacks......Page 442
Creating Records Directly from Form Parameters......Page 443
Don't Trust ID Parameters......Page 444
Don't Expose Controller Methods......Page 445
File Uploads......Page 446
Don't Cache Authenticated Pages......Page 447
Knowing That It Works......Page 448
Picking a Production Platform......Page 449
A Trinity of Environments......Page 457
Iterating in the Wild......Page 459
Maintenance......Page 463
Scaling: The Share-Nothing Architecture......Page 464
Finding and Dealing with Bottlenecks......Page 468
Case Studies: Rails Running Daily......Page 472
Appendices......Page 475
Ruby Is an Object-Oriented Language......Page 476
Ruby Names......Page 477
Methods......Page 478
Classes......Page 480
Arrays and Hashes......Page 482
Control Structures......Page 484
Blocks and Iterators......Page 485
Exceptions......Page 486
Interactive Ruby......Page 487
Ruby Idioms......Page 488
RDoc Documentation......Page 489
Active Record Configuration......Page 491
Action Pack Configuration......Page 492
Test Case Configuration......Page 494
The Full Depot Application......Page 495
Sample System Notifier......Page 520
Cross-Reference of Code Samples......Page 521
Bibliography......Page 525
Index......Page 526

Agile web development with rails: a Pragmatic guide [1 ed.]
 097669400X, 9780976694007

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers