small medium large xlarge

Agile Web Development with Rails 5.1


Cover image for Agile Web Development with Rails 5.1

Agile Web Development with Rails 5.1


Learn Rails the way the Rails core team recommends it, along with the tens of thousands of developers who have used this broad, far-reaching tutorial and reference. If you’re new to Rails, you’ll get step-by-step guidance. If you’re an experienced developer, get the comprehensive, insider information you need for the latest version of Ruby on Rails. The new edition of this award-winning classic is completely updated for Rails 5.1 and Ruby 2.4, with information on system testing, Webpack, and advanced JavaScript.


This edition covers Rails 5.1.

The edition covering Rails 6 is available here: Rails 6

The edition covering Rails 4 is available here: Rails 4


Customer Reviews

The best book to get started in the Rails world. A comprehensive, coherent, and
concise overview of the Ruby on Rails framework. It treats learning in a gradual
way, creating an application from scratch using the latest technologies.

- Luis Miguel Cabezas Granado

Ruby on Rails and PHP developer at Junta de Extremadura (Spain) and PHP book writer at Anaya Multimedia

I liked how the book guided me through each step of the tasks. This book gives
a thorough introduction to Rails, and I’d suggest it to anyone who wants to start
development with Rails.

- Gábor László Hajba

Software Developer, EBCONT Enterprise Technologies

The book was really pleasant to read; I liked how it creates a foundational understanding
of Rails with a realistic scenario and then builds upon it for the more
advanced topics.

- Alessandro Bahgat

Software Engineer, Google

See All Reviews

Choose Your Format(s)

  • $29.95 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

What You Need

All you need is a Windows, Mac OS X, or Linux machine to do development on. This book will take you through the steps to install Rails and its dependencies. If you aren’t familiar with the Ruby programming language, this book contains a chapter that covers the basics necessary to understand the material in the book.

Contents & Extracts



  • Getting Started
    • Installing Rails
      • Installing on Cloud9
      • Installing on a Virtual Machine
      • Installing on Windows
      • Installing on Mac OS X
      • Installing on Linux
      • Choosing a Rails Version
      • Setting Up Your Development Environment
      • Rails and Databases
    • Instant Gratification
      • Creating a New Application
      • Hello, Rails! excerpt
      • Linking Pages Together
      • When Things Go Wrong
    • The Architecture of Rails Applications
      • Models, Views, and Controllers
      • Rails Model Support
      • Action Pack: The View and Controller
    • Introduction to Ruby
      • Ruby Is an Object-Oriented Language
      • Data Types
      • Logic
      • Organizing Structures
      • Marshaling Objects
      • Pulling It All Together
      • Ruby Idioms
  • Building an Application
    • The Depot Application
      • Incremental Development
      • What Depot Does
      • Let’s Code
    • Task A: Creating the Application
      • Iteration A1: Creating the Product Maintenance Application
      • Iteration A2: Making Prettier Listings
    • Task B: Validation and Unit Testing
      • Iteration B1: Validating!
      • Iteration B2: Unit Testing of Models
    • Task C: Catalog Display
      • Iteration C1: Creating the Catalog Listing
      • Iteration C2: Adding a Page Layout
      • Iteration C3: Using a Helper to Format the Price
      • Iteration C4: Functional Testing of Controllers
      • Iteration C5: Caching of Partial Results
      • What We Just Did
    • Task D: Cart Creation
      • Iteration D1: Finding a Cart
      • Iteration D2: Connecting Products to Carts
      • Iteration D3: Adding a Button
    • Task E: A Smarter Cart
      • Iteration E1: Creating a Smarter Cart
      • Iteration E2: Handling Errors
      • Iteration E3: Finishing the Cart
    • Task F: Add a Dash of Ajax
      • Iteration F1: Moving the Cart
      • Iteration F2: Creating an Ajax-Based Cart
      • Iteration F3: Highlighting Changes
      • Iteration F4: Hiding an Empty Cart
      • Iteration F5: Broadcasting Updates with Action Cable
    • Task G: Check Out!
      • Iteration G1: Capturing an Order
      • Iteration G2: Atom Feeds
    • Task H: Entering Additional Payment Details excerpt
      • Iteration H1: Adding Fields Dynamically to a Form
      • Iteration H2: Testing our JavaScript Functionality
    • Task I: Sending Mail
      • Iteration I1: Sending Confirmation Emails
      • Iteration I2: Integration Testing of Applications
    • Task J: Logging In
      • Iteration J1: Adding Users
      • Iteration J2: Authenticating Users
      • Iteration J3: Limiting Access
      • Iteration J4: Adding a Sidebar, More Administration
    • Task K: Internationalization
      • Iteration K1: Selecting the Locale
      • Iteration K2: Translating the Storefront
      • Iteration K3: Translating Checkout
      • Iteration K4: Add a Locale Switcher
    • Task L: Deployment and Production
      • Iteration L1: Deploying with Phusion Passenger and MySQL
      • Iteration L2: Deploying Remotely with Capistrano
      • Iteration L3: Checking Up on a Deployed Application
    • Depot Retrospective
      • Rails Concepts
      • Documenting What We’ve Done
  • Rails in Depth
    • Finding Your Way Around Rails excerpt
      • Where Things Go
      • Naming Conventions
    • Active Record
      • Defining Your Data
      • Locating and Traversing Records
      • Creating, Reading, Updating, and Deleting (CRUD)
      • Participating in the Monitoring Process
      • Transactions
    • Action Dispatch and Action Controller
      • Dispatching Requests to Controllers
      • Processing of Requests
      • Objects and Operations That Span Requests
    • Action View
      • Using Templates
      • Generating Forms
      • Processing Forms
      • Uploading Files to Rails Applications
      • Using Helpers
      • Reducing Maintenance with Layouts and Partials
    • Migrations
      • Creating and Running Migrations
      • Anatomy of a Migration
      • Managing Tables
      • Advanced Migrations
      • When Migrations Go Bad
      • Schema Manipulation Outside Migrations
    • Nonbrowser Applications
      • A Stand-Alone Application Using Active Record
      • A Library Function Using Active Support
    • Rails’ Dependencies
      • Generating XML with Builder
      • Generating HTML with ERB
      • Managing Dependencies with Bundler
      • Interfacing with the Web Server with Rack
      • Automating Tasks with Rake
      • Survey of Rails’ Dependencies
    • Rails Plugins
      • Credit Card Processing with Active Merchant
      • Beautifying Our Markup with Haml
      • Pagination
      • Additional Plugins worth Exploring
    • Where to Go from Here


Sam Ruby is president of the Apache Software Foundation, previously co-chaired the W3C HTML Working Group, and has made significant contributions to many open source projects and standards.

David Bryant Copeland has been a professional programmer since 1995. He’s the author of Build Awesome Command-Line Applications in Ruby 2 and Rails, Angular, Postgres, and Bootstrap. He has worked at LivingSocial and Opower, and is the director of engineering at fashion start-up Stitch Fix.

Dave Thomas, as one of the authors of the Agile Manifesto, understands agility. As the author of Programming Ruby, he understands Ruby. And, as an active Rails developer, he knows Rails.