I picked up this book after reading a different Rails book. The other book was okay, but left me with a lot of questions. That is not the case with this book. The first section of the book is real basic while you build an e-commerce application. The second half of the book shines. It goes into great detail about the framework, and how all the different aspects of Rails tie together. I would recommend this book to anyone looking into Rails. Newbie or intermediate.
Author(s): Sam Ruby, Dave Thomas, David Heinemeier Hansson
Edition: 3
Publisher: Pragmatic Bookshelf
Year: 2009
Language: English
Pages: 766
Contents......Page 5
Preface to the Second Edition......Page 11
Preface to the Third Edition......Page 13
Introduction......Page 14
Rails Is Agile......Page 16
Finding Your Way Around......Page 17
Acknowledgments......Page 19
Getting Started......Page 21
Models, Views, and Controllers......Page 22
Active Record: Rails Model Support......Page 25
Action Pack: The View and Controller......Page 29
Installing on Windows......Page 31
Installing on Mac OS X......Page 33
Installing on Linux......Page 34
Development Environments......Page 36
Rails and Databases......Page 40
Rails and ISPs......Page 42
Creating a New Application......Page 44
Hello, Rails!......Page 46
Linking Pages Together......Page 57
What We Just Did......Page 61
Building an Application......Page 62
Incremental Development......Page 63
What Depot Does......Page 64
Let's Code......Page 68
Iteration A1: Getting Something Running......Page 69
Creating the Products Model and Maintenance Application......Page 75
Iteration A2: Adding a Missing Column......Page 79
Iteration A3: Validating!......Page 85
Iteration A4: Making Prettier Listings......Page 89
Iteration B1: Creating the Catalog Listing......Page 95
Iteration B2: Adding a Page Layout......Page 99
Iteration B3: Using a Helper to Format the Price......Page 101
Iteration B4: Linking to the Cart......Page 102
Sessions......Page 105
Iteration C1: Creating a Cart......Page 109
Iteration C2: Creating a Smarter Cart......Page 112
Iteration C3: Handling Errors......Page 115
Iteration C4: Finishing the Cart......Page 120
Task D: Add a Dash of Ajax......Page 124
Iteration D1: Moving the Cart......Page 125
Iteration D2: Creating an Ajax-Based Cart......Page 130
Iteration D3: Highlighting Changes......Page 133
Iteration D4: Hiding an Empty Cart......Page 136
Iteration D5: Degrading If Javascript Is Disabled......Page 139
What We Just Did......Page 140
Iteration E1: Capturing an Order......Page 142
Iteration F1: Adding Users......Page 159
Iteration F2: Logging In......Page 168
Iteration F3: Limiting Access......Page 171
Iteration F4: Adding a Sidebar, More Administration......Page 174
Generating the XML Feed......Page 181
Finishing Up......Page 191
Iteration I1: Enabling Translation......Page 193
Iteration I2: Exploring Strategies for Content......Page 207
Tests Baked Right In......Page 210
Unit Testing of Models......Page 211
Functional Testing of Controllers......Page 224
Integration Testing of Applications......Page 240
Performance Testing......Page 249
Using Mock Objects......Page 253
Working with the Rails Framework......Page 256
Directory Structure......Page 257
Rails Configuration......Page 264
Naming Conventions......Page 268
Debugging Hints......Page 272
What's Next......Page 274
Generally Available Extensions......Page 275
Enumerations and Arrays......Page 276
String Extensions......Page 278
Extensions to Numbers......Page 281
Time and Date Extensions......Page 282
with_options......Page 284
Unicode Support......Page 285
Migrations......Page 291
Creating and Running Migrations......Page 293
Anatomy of a Migration......Page 295
Managing Tables......Page 299
Data Migrations......Page 304
Advanced Migrations......Page 307
When Migrations Go Bad......Page 311
Schema Manipulation Outside Migrations......Page 312
Managing Migrations......Page 313
Active Record: The Basics......Page 315
Columns and Attributes......Page 316
Primary Keys and ids......Page 320
Connecting to the Database......Page 322
Create, Read, Update, Delete (CRUD)......Page 327
Aggregation and Structured Data......Page 346
Miscellany......Page 353
Active Record: Relationships Between Tables......Page 357
Creating Foreign Keys......Page 358
Specifying Relationships in Models......Page 360
belongs_to and has_xxx Declarations......Page 362
Joining to Multiple Tables......Page 377
Self-referential Joins......Page 387
Acts As......Page 388
When Things Get Saved......Page 392
Preloading Child Rows......Page 394
Counters......Page 395
Validation......Page 397
Callbacks......Page 407
Advanced Attributes......Page 414
Transactions......Page 418
The Basics......Page 425
Routing Requests......Page 426
Resource-Based Routing......Page 441
Testing Routing......Page 458
Action Methods......Page 461
Cookies and Sessions......Page 473
Flash: Communicating Between Actions......Page 486
Filters and Verification......Page 488
Caching, Part One......Page 496
The Problem with GET Requests......Page 505
Templates......Page 508
Using Helpers......Page 514
Helpers for Formatting, Linking, and Pagination......Page 515
How Forms Work......Page 523
Forms That Wrap Model Objects......Page 524
Custom Form Builders......Page 537
Working with Nonmodel Fields......Page 541
Uploading Files to Rails Applications......Page 544
Layouts and Components......Page 548
Caching, Part Two......Page 555
Adding New Templating Systems......Page 560
Prototype......Page 563
Script.aculo.us......Page 583
RJS Templates......Page 600
Conclusion......Page 607
Sending E-mail......Page 609
Receiving E-mail......Page 620
Testing E-mail......Page 622
Alternatives to Active Resource......Page 625
Show Me the Code!......Page 628
Relationships and Collections......Page 631
Pulling It All Together......Page 634
Securing and Deploying Your Application......Page 636
SQL Injection......Page 637
Creating Records Directly from Form Parameters......Page 640
Don't Trust id Parameters......Page 641
Don't Expose Controller Methods......Page 642
Cross-Site Scripting (CSS/XSS)......Page 643
File Uploads......Page 646
Don't Store Sensitive Information in the Clear......Page 647
Use SSL to Transmit Sensitive Information......Page 648
Knowing That It Works......Page 650
Starting Early......Page 651
How a Production Server Works......Page 652
Installing Passenger......Page 655
Worry-Free Deployment with Capistrano......Page 657
Checking Up on a Deployed Application......Page 661
Production Application Chores......Page 662
Moving On to Launch and Beyond......Page 664
Appendixes......Page 665
Ruby Is an Object-Oriented Language......Page 666
Ruby Names......Page 667
Methods......Page 668
Classes......Page 670
Modules......Page 672
Arrays and Hashes......Page 673
Control Structures......Page 674
Blocks and Iterators......Page 675
Exceptions......Page 676
Ruby Idioms......Page 677
RDoc Documentation......Page 679
Top-Level Configuration......Page 680
Active Record Configuration......Page 682
Action Controller Configuration......Page 684
Action Mailer Configuration......Page 686
Test Case Configuration......Page 688
The Full Depot Application......Page 689
Online Resources......Page 727
A......Page 729
C......Page 736
D......Page 740
E......Page 743
F......Page 744
G......Page 745
H......Page 746
I......Page 747
L......Page 748
M......Page 749
N......Page 750
P......Page 751
Q......Page 754
R......Page 755
S......Page 758
T......Page 760
V......Page 763
X......Page 764
Z......Page 765