Rails just keeps on changing. Both Rails 3 and 4, as well as Ruby 1.9 and 2.0, bring hundreds of improvements, including new APIs and substantial performance enhancements. The fourth edition of this award-winning classic has been reorganized and refocused so it’s more useful than ever before for developers new to Ruby and Rails.

Rails 4 introduces a number of user-facing changes, and the book has been updated to match all the latest changes and new best practices in Rails. This includes full support for Ruby 2.0, controller concerns, Russian Doll caching, strong parameters, Turbolinks, new test and bin directory layouts, and much more.

(Looking for earlier versions? Rails 3.2 Edition is still available in ebook and paper).

Buy Now

Select a DRM-free Format:

In Stock
In Stock
In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • mobi (for Kindle)
  • PDF
We can automatically send them to your Kindle or Dropbox, and for a social reading experience we can link the book to your Readmill account. (You'll need to log in to enable these options.)
 

About this Book

  • 456 pages
  • Published:
  • Release: P2.0 (2014-03-31)
  • ISBN: 978-1-93778-556-7

Ruby on Rails helps you produce high-quality, beautiful-looking web applications quickly. You concentrate on creating the application, and Rails takes care of the details.

Tens of thousands of developers have used this award-winning book to learn Rails. It’s a broad, far-reaching tutorial and reference that’s recommended by the Rails core team. If you’re new to Rails, you’ll get step-by-step guidance. If you’re an experienced developer, this book will give you the comprehensive, insider information you need.

Rails has evolved over the years, and this book has evolved along with it. We still start with a step-by-step walkthrough of building a real application, and in-depth chapters look at the built-in Rails features. This edition now gives new Ruby and Rails users more information on the Ruby language and takes more time to explain key concepts throughout. Best practices on how to apply Rails continue to change, and this edition keeps up. Examples use Concerns, Russian Doll caching, and Turbolinks, and the book focuses throughout on the right way to use Rails. Additionally, this edition now works on Ruby 2.0, a new release of Ruby with substantial functional and performance improvements.

This edition is for Rails 4.0 and beyond.

Learn Rails 4 Online at the Pragmatic Studio

Want to learn how to build Rails 4 apps interactively through engaging videos and hands-on exercises? Check out The Pragmatic Studio’s online Ruby on Rails Programming course.

In this online, self-paced course you’ll learn the fundamentals every Rails developer should know, and how to put all the pieces together, so you can confidently create your first Rails app or jump right into an existing app. Throughout the course you’ll also learn key design principles and practices to help you craft robust and flexible Rails apps.

“One of the best learning experiences I’ve ever had! I’ve gone through many courses and books. From all of these, your Rails course is the best in terms of teaching style, course structure, topics, and being up-to-date with Rails 4.” — Mate Kaszas

Contents and Extracts

Full Table of Contents

Introduction

  • Getting Started
  • Building an Application
    • The Depot Application
    • Task A: Creating the Application
    • Task B: Validation and Unit Testing
    • Task C: Catalog Display
    • Task D: Cart Creation
    • Task E: A Smarter Cart
    • Task F: Add a Dash of Ajax
    • Task G: Check Out!
    • Task H: Sending Mail
    • Task I: Logging In
    • Task J: Internationalization
    • Task K: Deployment and Production
    • Depot Retrospective
  • Rails in Depth
    • Finding Your Way Around Rails
    • Active Record
    • Action Dispatch and Action Controller
    • Action View
    • Caching
    • Migrations
    • Non-Browser Applications
    • Rails’ Dependencies
    • Rails Plugins
    • Where to Go From Here

About the Author

Sam Ruby is a prominent software developer who is a co-chair of the W3C HTML Working Group and has made significant contributions to many of the Apache Software Foundation’s open source software projects. He is a Senior Technical Staff Member in the Emerging Technologies Group of IBM.

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.

David Heinemeier Hansson is the creator of the Rails framework.

Upcoming Author Events

Comments and Reviews

  • When I started learning Ruby on Rails, I read the first edition of this book. Its holistic view of the Rails framework and community provides any new developer the kick start they need to a highly successful career. After reading through the latest edition cover to cover, I can happily say that it continues that trend and remains the first book I recommend to any new Rails developer.

    —Mikel Lindsaar Rails core commit team, creator of the Ruby Mail library, and director, RubyX
  • Agile Web Development with Rails does an excellent job of making the Rails environment accessible in an enjoyable and memorable way. In addition, this book is the first I’ve seen that provides a sensible and coherent explanation of the MVC pattern, and it does so in a natural progression using examples that completely remove any mystery.

    —Ken Coar Author, open software evangelist, and Apache developer
  • Agile Web Development with Rails successfully straddles a fine line between being a fun-to-read introduction to Rails (and Ruby) and a straightforward guide to some advanced features of the platform, nicely supplanting the everchanging online documentation.

    —Glen Daniels Independent technologist and consultant
  • I’ve never read a programming book as successful as Agile Web Development with Rails. Sam made learning Ruby on Rails easy, comprehensive, and fun.

    —Keith Ballinger Chairman of WS-I’s first Basic Profile working group; author; and key contributor to the .NET and Visual Studio .NET frameworks