Ruby on Rails Tutorial News

Softcover – A publishing platform based on the Rails Tutorial

When I published the first four chapters of the Ruby on Rails Tutorial in 2009, it represented an experiment: would it be possible to give away a book for free online while still making a successful product business? The answer, happily, turned out to be yes. I have been pleased at how many people have been able to use the free online version of the Ruby on Rails Tutorial book to learn web development. At the same time, right from the beginning sales of the Rails Tutorial ebooks and screencast videos have made it profitable as well. It’s been deeply gratifying to be able to play a role in lowering the financial barrier to acquiring such a valuable skill as web development while still building a sustainable business.

Now, I’m pleased to announce Softcover, a publishing platform based on the Rails Tutorial production system and business model. Using Softcover, authors can build multi-format ebooks (HTML, EPUB, MOBI, and PDF) from common source files, optionally bundle them with media like screencast videos, and publish them to Softcover’s integrated sales platform with a single command. Of course, Softcover also outputs an HTML version of each book—which, as with the Rails Tutorial, authors can (optionally) make available for free online.

To see what a full product on Softcover looks like, check out Conquering the Command Line, a book and screencast series on Linux and Unix commands by author Mark Bates, which (like the Rails Tutorial) includes a free online version. In addition, there is already a version of the Rails Tutorial book that builds on Softcover, and in the coming weeks I plan to move the full tutorial over to the Softcover platform (taking care to preserve things like legacy download links). Watch for an announcement once the change-over is complete.

My hope is that Softcover will help allow many other authors to replicate the success of the Ruby on Rails Tutorial. If you’re interested in using Softcover yourself, you can learn a little more about it on the Softcover home page. Then sign up for an account and follow the instructions on the start page.

Japanese translation of the Rails Tutorial

I’m pleased to announce the availability of a translation of the Ruby on Rails Tutorial to Japanese, the native language of Ruby creator Yukihiro “Matz” Matsumoto. I’ve had the pleasure of meeting Matz and several other Japanese Ruby developers over the years, and they’ve always impressed me both with their technical brilliance and their friendliness. I consider it a great honor that Yohei Yasukawa, Shozo Hatta, and their fellow contributors have chosen to translate the Rails Tutorial to Japanese, and I thank them for their excellent work.

As with the English version of the Rails Tutorial, the Japanese translation is available for free online as HTML; with my blessing, the Japanese translators are also offering ebook sales of the translation, the proceeds of which go to support their efforts. If you are a Japanese speaker, please check it out!

Rails Tutorial updated for Rails 4.0.1

I’ve just updated the Ruby on Rails Tutorial book for the newest Rails release, Rails 4.0.1. If you’re updating your sample_app to Rails 4.0.1, you’ll need to change rails to 4.0.1 and bcrypt-ruby to 3.1.2, as seen in the reference sample app Gemfile:

1
2
3
4
5
6
7
8
9
10
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.1'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.1.2'
.
.
.

Then run

1
2
3
4
bundle install
bundle update
bundle install
rspec spec/

(I’m actually not sure if both calls to bundle install are necessary, but they can’t hurt.)

As far as I can tell, there are no changes between Rails 4.0.0 and 4.0.1 that affect the Rails Tutorial, but please let me know if you run into any issues.

Rails 4.0 ebooks and supplementary screencasts

tl;dr: Rails Tutorial products updated for Rails 4.0 are now available. Current customers should check their email for generous coupon codes; new customers can use the code rails4launch by Monday, July 22, to get a 25% launch discount.

I’ve just launched sales of two new products, motivated by the recent release of Rails 4.0. The first product is the Rails 4.0 version of the Ruby on Rails Tutorial book in the three most popular ebook formats (PDF/EPUB/MOBI) . As noted in a previous post, the 4.0 version is not a completely new edition, but it is 100% compatible with Rails 4.0 and covers a significant number of new features (now listed in Box 1.1 of the new version).

The second new product is a pair of supplementary screencasts on Rails 4.0 based on an all-new supplementary chapter that is part of an enhanced 2nd edition of the book. The supplementary screencasts include a live demo of upgrading the Rails Tutorial sample application from Rails 3.2 to Rails 4.0, a discussion of the new strong parameters technique for preventing mass assignment vulnerabilities, and two new security updates (dynamic secret tokens and encrypted remember tokens). Note that, in keeping with the tutorial’s principal goal of being a general introduction to web development, the new chapter and screencasts do not attempt to cover all the new features in Rails 4.0. For those interested in keeping up-to-date with the latest Rails techniques, I recommend RailsCasts.

As usual, the full text of the book is available for free online, including the Rails 4.0 version and the supplementary chapter.

To meet the needs of the largest number of customers, the new products are available in several ways:

  • The ebooks now include both the full Rails 4.0 version and the 2nd edition with the new supplementary chapter. Recommended for current ebook customers and new customers who don’t want screencasts

  • The ebook/screencast bundle now includes the enhanced 2nd edition book, the 4.0 version of the book, and the Rails 4.0 supplementary screencasts, as well as the full 1st and 2nd edition screencast series. Recommended for new customers who learn well from screencasts

  • A new supplement bundle combines the enhanced 2nd edition book, the 4.0 version of the book, and the Rails 4.0 supplementary screencasts. Recommended for current ebook/screencast customers

If you do decide to buy a Rails 4.0 product, be sure to use the code rails4launch by Monday, July 22, to get a 25% launch discount, unless you are current customer. Current Rails Tutorial customers should check their email to find coupon codes for special discounts on the new products. (You might notice that the prices have gone up with the addition of the new products; the discounts are large enough that current customers are still better off having bought things earlier rather than later.)

One more test post

The recent switch to Heroku ferreted out an annoying bug in the Rails Tutorial News Feed, namely, hard-coded GitHub Pages URLs deep in the site’s configuration. All the links on the site itself were fine, but the Atom feed had the obsolete GitHub Pages addresses. I’m glad to find out about this, as I certainly never meant to expose those URLs, preferring to use custom subdomains (e.g., news.railstutorial.org) whenever possible. So, the prophecy in my last post that this sort of issue wouldn’t soon happen again has gone unfulfilled, but I’m optimistic that this is indeed the last time.

I’ve changed over the feed to use the proper news.railstutorial.org URLs, but it might take a few days for all the caches with the old feed to expire. Thanks for your patience, and sorry for all the noise.

Switching the news feed to Heroku

After having some trouble with the refresh times on GitHub Pages, a few days ago I switched the Rails Tutorial News Feed over to Heroku. Some of you may have noticed a large number of unread articles in your feed reader or email summary; this change from Pages to Heroku is the reason why, as it forced a regeneration of the site’s Atom feed. Now I’ve discovered that a few posts got lost in the transition; I’ve added them back, which means another chunk of “unread” items may show up in your reader or inbox. The Heroku site is now working well, though, so I’m optimistic that this kind of thing won’t happen again any time soon.

A more secure remember token

I recently received a helpful email from reader Yuri Krichevsky pointing out a way to improve the security of the “remember me” tokens used in the Ruby on Rails Tutorial book. Since I’m gearing up to release the Rails 4.0–compatible version, I decided to go ahead and implement the more secure method. The result appears starting in Section 8.2.1 of the new version, with the corresponding sample app code available on GitHub. I’ve edited it carefully, but there were a lot of little changes, so it’s possible some errors slipped through. If you get the chance, please take a look at it and let me know if it works as advertised.

Rails Tutorial for Rails 4.0 final

I’ve updated the Ruby on Rails Tutorial book to use the recently released Rails 4.0 final. I’ll give people a chance to look at it for a week or two and then switch it over to the default at railstutorial.org. I also plan to produce a supplementary screencast on Rails 4.0, updating the book’s sample app and covering some of the relevant diffs with Rails 3.2.

Within a few weeks, I expect to release the supplementary screencast and ebook of the 4.0 version as a standalone product, available at a large discount to current customers. Once I feel the changes in Rails justify the effort (probably later this year), I plan to produce a full new 3rd edition and a new screencast series. These will also be available at a discount to current customers.

The full 3rd edition will include everything in the current version, as well as some optional updates to the RSpec syntax for integration tests and probably some coverage of Turbolinks and Russian-doll caching. I also anticipate there being a new Rails release or two before then, presumably bringing some additional changes.

It’s worth bearing in mind that the purpose of the Rails Tutorial is to teach web development with Rails, not principally to keep people up-to-date on the latest Rails techniques. In the context of an introductory tutorial, the differences between Rails 3.2 and Rails 4.0 are minor. If you are already an experienced Rails developer and want to keep up with latest techniques in Rails, I recommend Ryan Bates’s RailsCasts.

RubyMine Tips Screencast

My preferred text editor for Ruby on Rails development is Sublime Text 2, but I keep hearing great things about RubyMine. In advance of the release of the 2nd edition of the Ruby on Rails Tutorial book, last year I released a short Sublime Text 2 for Rails screencast; I’m pleased to announce that Justin Gordon (@railsonmaui) has produced a companion RubyMine tips screencast that does a great job of showing off what RubyMine can do, especially in the context of a Ruby on Rails application. I encourage everyone with an interest in using an IDE for Rails development to check out Justin’s screencast.