Agile web development with rails: a Pragmatic guide

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Rails is a full-stack, open source web framework that enables you to create full-featured, sophisticated web-based applications, but with a twist... A full Rails application probably has less total code than the XML you'd need to configure the same application in other frameworks. With this book you'll learn how to use "ActiveRecord" to connect business objects and database tables. No more painful object-relational mapping. Just create your business objects and let Rails do the rest. You'll learn how to use the "Action Pack" framework to route incoming requests and render pages using easy-to-write templates and components. See how to exploit the Rails service frameworks to send emails, implement web services, and create dynamic, user-centric web-pages using built-in Javascript and Ajax support. There are extensive chapters on testing, deployment, and scaling. You'll see how easy it is to install Rails using your web server of choice (such as Apache or lighttpd) or using its own included web server. You'll be writing applications that work with your favorite database (MySQL, Oracle, Postgres, and more) in no time at all. You'll create a complete online store application in the extended tutorial section, so you'll see how a full Rails application is developed---iteratively and rapidly. Rails strives to honor the Pragmatic Programmer's "DRY Principle" by avoiding the extra work of configuration files and code annotations. You can develop in real-time: make a change, and watch it work immediately. Forget XML. Everything in Rails, from templates to control flow to business logic, is written in Ruby, the language of choice for programmers who like to get the job done well (and leave work ontime for a change). Rails is the framework of choice for the new generation of Web 2.0 developers. Agile Web Development with Rails is the book for that generation, written by Dave Thomas (Pragmatic Programmer and author of Programming Ruby) and David Heinemeier Hansson, who created Rails.

Author(s): Dave Thomas, David Heinemeier Hansson, Leon Breedt, Mike Clark, Thomas Fuchs, Andrea Schwarz
Series: Pragmatic Programmers
Edition: 1
Publisher: Pragmatic Bookshelf
Year: 2005

Language: English
Pages: 554
City: Raleigh, N.C

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