Archive RSS Email

A couple bugs, with fixes

Mar 19, 2010 • posted by Michael Hartl

I've fixed a couple of bugs in the recently released Sign in, sign out chapter. Any readers who have already worked the chapter should update their code using the latest version. (Be sure to reload your browser and clear your browser cache to make sure you have the freshest release.)

First, Listing 8.19 has been updated to prevent users with nil remember tokens from being automatically signed in. Second, and more seriously, Listing 8.14 has been updated to allow users to sign in, sign out, and then sign in again. As originally written, users could only sign in once, which probably counts as a serious bug. :-) If you've already run into this issue, you should reset the affected user's password using the console:

$ script/console>> user = User.first # or whichever one it is>> user.update_attributes(:password => "foobar", :password_confirmation => "foobar")

Then restart your development server.

Thanks to the several readers who have already caught issues in this chapter, and especially to batkins for catching the multiple-sign-in bug.

Michael Hartl

I’m Michael Hartl—author, educator, and entrepreneur. I’m probably best known as the creator of the Ruby on Rails Tutorial, a book and screencast series that together constitute one of the leading introductions to web development. Once called his “favorite book” by Wikipedia founder Jimmy Wales, the Ruby on Rails Tutorial currently has over 150 5-star reviews at Amazon. I’m also (in)famous for creating Tau Day and The Tau Manifesto, which have inspired an international movement dedicated to the proposition that “pi is wrong.” (For example, as a result of The Tau Manifesto, MIT releases their admissions decisions each year at “Tau Time” (6:28 p.m.), and typing tau/2 at Google yields 3.14159…) Finally, I’m a founder of Softcover, a publishing system and sales platform for technical authors, which among other things powers both The Tau Manifesto and the Ruby on Rails Tutorial.

I’m a graduate of Harvard College and have a Ph.D. in Physics from Caltech, where I studied black hole dynamics and was an award-winning instructor in theoretical and computational physics. I’m also an alumnus of Y Combinator, the entrepreneur program that has produced companies such as Dropbox and Airbnb. (Alas, my own Y Combinator startup was neither Dropbox nor Airbnb.)