Agile Web Development with Rails 5.1
by Sam Ruby, David Bryant Copeland, with Dave Thomas
Version: P1.0 (November 2017)
Copyright 2017 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/frequently-asked-questions/ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/rails51, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Andy Hunt (Publisher) Janet Furlow (VP of Operations) Susannah Davidson Pfalzer (Development Editor) Potomac Indexing, LLC (Indexing) Molly McBeath (Copy Editor) Gilson Graphics (Layout)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Copyright 2017, The Pragmatic Bookshelf.
Early praise for Agile Web Development with Rails 5.1
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 Id suggest it to anyone who wants to start development with Rails.
Gbor Lszl 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 |
Foreword to the Rails 5 Edition
Youve made a great decision to learn Ruby on Rails. The language, framework, and community have never been in better shape, and the community has never been easier to join than it is today. The early days of the frontier are gone, and while some of the cowboy excitement went with it, what we have instead is a sophisticated, modern, and functional state.
The spoils of such progress will hopefully become apparent as you work your way through this book. Ruby on Rails takes care of an inordinate amount of what most developers need most of the time. In the world of web development, thats an awful lot! An overwhelming lot at times.
But dont be intimidated. You dont need to understand every fine point and every minutia before you can begin to make progress. Ruby on Rails has been designed to flatten the learning curve as much as possible while at the same time encouraging you to level up over time.
Becoming an expert in full-stack web development wont happen overnight. Even Ruby on Rails cant replace the inherent depth of knowledge required to understand every facet, from HTTP to databases to JavaScript to object-oriented best practices to testing methodologies. One day youll be able to converse fluently about all that, but dont worry or expect that to be twenty-one days from now (or whatever snake-oil sales speak some publishers might try to push on you).
The journey from here to there is half the fun. Youve arrived in a community that cares an extraordinary amount about the craft of writing great software for the web. This might seem a little strange at first: is it really possible to care that much whether an if-statement is at the beginning of a conditional or if its an unless-statement at the end? Yes, yes it is. Helping more programmers develop an eye for such details is a big part of our mission here.
Because Ruby on Rails isnt just about getting stuff done quickly. Thats part of it, but its the lesser one. The greater appeal is in making software for the web fun, rewarding, and inspiring. To make learning all the nooks and crannies of our crazy craft an adventure.
Every new version of Rails expands the scope of what we try to tackle together. This is unapologetically not a minimalist framework. And Rails 5 is no different. With this major new version weve opened the door to a major new domain: the real-time web. Youre in for a real treat here as well.
But lets not get ahead of ourselves. You have much to learn, and I cant wait to see what you do with it. Ive been programming in Ruby and working on Rails for the past thirteen years. It never ceases to inspire and motivate me to see new developers discover our wonderful language and framework for the first time. In some ways, Im even jealous.