Chapter 7 update

As a couple different readers noted, there was a mistake in the flow of Chapter 7 of the Ruby on Rails Tutorial book: the error messages shown in Figure 7.5 didn't actually appear in the tutorial as written, since there was no call to @user.save in the create action to generate them. In the process of fixing this problem, I realized there were other structural issues that needed to be addressed, including properly test-driving the failing create action and introducing message expectations a little earlier. The result is that Section 7.2: Signup failure has been substantially rewritten, and Section 7.3: Signup success has been revised as well. If you've already worked through Chapter 7, you might want to revisit the updated sections so that you'll be ready for Chapter 8, which I hope to release some time next week.

Chapter 7 of the Ruby on Rails Tutorial book

Chapter 7 is out. It uses Rails 2.3.5 as before, and I'll keep using Rails 2.3 until at least a Rails 3.0 release candidate (RC) is available, but I have got a nice Rails 3 beta setup running so you can expect an updated tutorial in a very timely manner. :-)

Chapter 6 of the Ruby on Rails Tutorial book

A draft of Chapter 6 of the Ruby on Rails Tutorial book is out. Enjoy!

By the way, Rails 3 is due out any day now; as soon as I verify that all the book (and gem/plugin) code works, I'll convert the tutorial over to use Rails 3, and future chapters should be Rails 3–compatible from the start. (The switch to Rails 3 will temporarily break the Heroku deploys in the tutorial, but worry not—they are hard at work and will be supporting Rails 3 soon.) For current readers, the Rails 3 switch will probably mean working quickly through the tutorial a second time to update your code; I will be modifying the tutorial slightly to make this second run-through a little easier. Of course, I'll make a separate news announcement when the Rails 3–compatible tutorial is ready.

Links for section headings

Encouraged by some helpful user feedback, I've modified the HTML version of the Ruby on Rails Tutorial book to make links out of the section headings. This way, if you want to share a link to, say, Section 2.1, you can just right-click on the heading and select "Copy Link Location" to copy the URL into your clipboard buffer. (You could share section links before, but you had to navigate up to the Table of Contents and use the link there, which is inconvenient.) I hope this makes it easier to share and to link to any sections of the book you find particularly useful.

Chapter 5 of the Ruby on Rails Tutorial book is out

Chapter 5 of the Ruby on Rails Tutorial book is now available. I've also released a rewritten introduction and added a section on the model-view-controller architecture.

So far I've been impressed with both the quantity and quality of feedback on Rails Tutorial. As before, any comments, suggestions, or corrections are much appreciated.

Testing tools and an important note for Ruby 1.9 users

I've just deployed a rewrite of Section 2.2.1, which deals with the testing tools used in the Rails Tutorial book. In addition to general clarification, I added a critically important step for any readers using Ruby 1.9. I'm grateful for the reader feedback that identified an interaction issue between Ruby 1.9 and the most recent version of RSpec: if you're using Ruby 1.9 or plan to upgrade soon, be sure to see the note on Test::Unit in the section on Installing RSpec. And let me know if you have any comments or run into any problems in the rewritten section.

Poll results: RSpec in a landslide

The poll results are in: after nearly 90 votes, it's RSpec in a landslide. A full 76 of 87 respondents (87.36%) prefer RSpec for use in the Ruby on Rails Tutorial book. This is good news for me, since I know RSpec better, and I also have the specs through Chapter 6 already written. For those who voted for Test::Unit, I hope you'll come along for the RSpec ride; even though it's not currently the default, I believe RSpec is the Rails Way*, so these results are good news for you, too.

To make the introduction to RSpec a little gentler, I'll plan to add some more introductory information in Chapter 2, perhaps including a separate box on RSpec or a section on "anatomy of a spec". If you still run into any RSpec confusion, please let me know, and I'll do what I can to alleviate it.

*The Shoulda testing framework is a good alternate choice—the Other Rails Way, as it were.

Is RSpec too complex for Rails Tutorial?

I've gotten feedback that RSpec may be too complex for the Rails Tutorial book. Though I mainly use RSpec myself, there are advantages to using the default Test::Unit framework. If I'm ever going to switch from RSpec to Test::Unit, now is the time, since subsequent chapters will have many more tests and would require much more rewriting to change. I've set up a survey to get reader feedback about testing frameworks; please let me know what you think by taking the survey here.

Ruby on Rails Tutorial schedule

This is just a quick heads-up on the Ruby on Rails Tutorial schedule. I'm leaving tomorrow for a holiday trip to Very Far Away from Anywhere, Alaska, so writing progress will be slow until the new year. Once I get back, I should be able to move forward fairly quickly: Chapter 5 was getting too big, so I cleaved it neatly in two, and now I have a good start on both Chapters 5 and 6. I hope to release them in January, and then try to keep up a 1–2 chapter per month pace until the book is done. Of course, I'll announce the availability of each chapter as it's released, both here and on the Rails Tutorial Twitter account.

By the way, the feedback so far has been both encouraging and very helpful. Thanks to everyone who's take the time to write in!

Ruby on Rails Tutorial PDF download now available

As some of you may already have seen on the recent Rails Inside post about Ruby on Rails Tutorial, the Ruby on Rails Tutorial book PDF is now available for download! It's still only chapters 1–4, of course, but I'll be keeping it in sync with the web version of the book from now on.

The Ruby on Rails Tutorial PDF will be available for free until the book is done (and possibly even after it's done, depending on the circumstances).

About

This is the news feed for Ruby on Rails Tutorial by Michael Hartl. Visit the main website for more information about the project. You should subscribe to the news feed and follow Rails Tutorial on Twitter for all the latest updates.

Subscribe via RSS »