In the past few years, the Ruby on Rails Tutorial book has become one of the leading introductions to web development. Both the 1st and 2nd editions have found broad audiences, and now I’m pleased to offer draft chapters of the 3rd edition, called Learn Web Development: The Ruby on Rails Tutorial. For reasons detailed below, I believe it’s the best edition yet. Drafts of the first few chapters are currently available, and I plan to add links to new chapters as they are released:
The 3rd edition of the Ruby on Rails Tutorial will follow the same basic model as previous editions: a free online version, with ebooks and screencasts available for purchase. I also plan to produce a solutions manual for the book’s exercises, which will probably be included with one or more product bundles.
Perhaps the most surprising feature of the 3rd edition is that it is simultaneously easier and more advanced than previous editions. Whereas previous editions required readers to climb (sometimes unavoidable) brick walls, the 3rd edition is more like a ramp: smoothly increasing in difficulty, but ultimately reaching a greater height than before.
Here are the main factors that make the 3rd edition easier:
Use of a standard integrated development environment in the cloud, with a pre-configured workspace specifically tailored to the needs of the Ruby on Rails Tutorial. Use of the custom Cloud9 IDE environment eliminates the installation and configuration overhead encountered in previous editions, while also providing the text editor, terminal window, and filesystem navigation necessary to complete the book’s three example applications.
100% default stack. The 3rd edition of the Ruby on Rails Tutorial uses the default Rails choices for all relevant technologies, thereby substantially reducing the configuration necessary to get started. The excellent but syntactically heavy RSpec testing framework has been replaced with the default Rails testing stack (MiniTest), making for a much gentler introduction to testing than in previous editions.
Lighter-weight testing approach. The 3rd edition still covers test-driven development (TDD), but uses it more sparingly and judiciously. The more forbidding “wall of tests” sections have been eliminated, with concise and expressive integration tests (usually written after the application code) taking their place.
Less emphasis on version-specific features. Rather than trying to incorporate mini-tutorials on new features for each version of Rails, the 3rd edition focuses on the most general principles of web development. This means that, although the tutorial does use the most recent Rails release, this fact is incidental, and it is not tightly coupled to the details of any particular version.
Highlighted lines and red/green indicators. By making use of features of the underlying Softcover self-publishing platform, the 3rd edition of the Ruby on Rails Tutorial now includes highlighted lines in many code samples, allowing readers to see at a glance which parts of the code are most important. In addition, many code listings now include explicit labels indicating whether the test suite should be passing or failing at that point in the tutorial, thereby orienting the reader and making the exposition much easier to follow. (See Listing 3.12 for an example.)
Meanwhile, these are the main factors that make the 3rd edition more advanced:
- A completely rewritten chapter on login and authentication. The newly revised Chapter 8 covers all three of the most common login models on the Web: session expiration upon browser close, automatically remembering users, and optionally remembering users with a “remember me” checkbox.
- An all-new section on image upload. Chapter 11 now shows how to add pictures to the Twitter-style “microposts” developed in the tutorial’s main sample application. Topics include client- and server-side image validations, automatic image resizing, and using a cloud storage service (Amazon S3) in production.
- An all-new chapter on account activation and password resets, including sending email with Rails. The all-new Chapter 10 considerably extends the core sample application by adding account activation (thereby verifying the account’s email address) and allowing users to reset forgotten passwords. In the process, the chapter covers how to send email with Rails, both in development (using the server log) and in production (using SendGrid).
I’m more excited about the 3rd edition of the Ruby on Rails Tutorial than about any previous version. As reflected the new primary title, Learn Web Development, I believe that the Ruby on Rails Tutorial constitutes not only a solid introduction to Rails, but also a thorough general introduction to web development. It wouldn’t be nearly as good as it is, though, without the contributions of hundreds (perhaps thousands) of readers who have taken the time to write in with bug & typo reports and other suggestions. As with previous editions, I thus look forward to getting feedback on the draft chapters of the 3rd edition of the Ruby on Rails Tutorial. And don’t forget to sign up here for priority notifications and an exclusive coupon code.