small medium large xlarge

Errata for Rails Recipes

 

The latest version of the book is P3.0, released over 9 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P3.0 (13-Sep-07)
#29653
Paper page: 1

It would be easier to find the samples in the download if they were ordered by Chapter Number. (JMHO)--TW Scannell

  • Reported in: P3.0 (14-May-07)
#29023
PDF page: 13
in_place_select_editor is missing some options that are in: See the rdoc for JavaScriptMacrosHelper.html This seems to work: def in_place_s...more...
  • Reported in: P3.0 (27-Apr-09)
#39018
PDF page: 13

Scriptaculous in_place_editor does not work with Rails 2.1 as described in the book.--Tim DeBaillie

  • Reported in: P3.0 (14-Sep-06)
#25916
PDF page: 32

"we put relative path to our JavaScript
action" -- it's an absolute path, no?--Mark Meves

  • Reported in: P3.0 (18-May-10)
#43308
PDF page: 45
Not sure whether the code here is correct in Rails 2.3.x What I have working so far is: module ApplicationHelper class TabularFormBuilder < ...more...
  • Reported in: P3.0 (13-Aug-07)
#29400
PDF page: 46

I tried the code, and the class CodeStatistics was not known. So I had to include require 'code_statistics' to get it to work.--Markus Liebelt

  • Reported in: P3.0 (07-Jul-06)
#25410
PDF page: 53
I'm not sure of the version of the text used in what I saw, because it is the pdf extract for "Rails Without a Database" (I do not currently have an a...more...
  • Reported in: P1.0 (18-Nov-08)
#35967
PDF page: 55
Paper page: Ztdaz

good guest page.
thank you.--gUuSOTgJueBOqIGst

  • Reported in: P3.0 (19-Sep-06)
#25943
PDF page: 57
In the final sentence of the first paragraph: ... all of its child classes (your application-specific) models. should read: ... all of its...more...
  • Reported in: P3.0 (19-Sep-06)
#25944
PDF page: 61

In the second sentence of the second paragraph, "You'd" should not be capitalized. --Mark Meves

  • Reported in: P3.0 (31-May-07)
#29175
PDF page: 71
Recipe 19, "Tagging Your Content", uses a plugin that is no longer available. Attempting to follow the book fails at the first step (script/plugin ins...more...
  • Reported in: P3.0 (04-Apr-07)
#28316
Paper page: 75
3rd paragraph: "Now we can find and destroy records by their primary keys:" An example follows which is wrapped in <![[CDATA ]]> tags by mistake. (The...more...
  • Reported in: P3.0 (01-Mar-08)
#31094
PDF page: 78
script/plugin discover script/plugin install acts_as_versioned --- This doesn't work chapter.version --- This doesn't work either As I got th...more...
  • Reported in: P1.0 (29-Jun-06)
#25356
PDF page: 80
In the 2nd example of versioning, the one that introduces chapter.revert_to(2), I don't understand the final version number. The example starts with 3...more...
  • Reported in: P3.0 (07-Apr-07)
#28378
Paper page: 86

4th paragraph: "--Sergei Yakovlev

  • Reported in: P3.0 (03-Jun-08)
#32264
Paper page: 87
Instead of "detail.tags.collect.." should the following be "contact.tags.collect.." ? <%= text_field_tag "tag_list", detail.tags.collect{|t...more...
  • Reported in: P3.0 (11-Apr-07)
#28461
PDF page: 101
I found the GradeFinder example very useful... but it took me a while to figure out how to reuse GradeFinder for the base class. For example, while S...more...
  • Reported in: P1.0 (21-Sep-06)
#25966
Paper page: 112

Don't forget to save the changes to the database:
>> address.save--Manu Cammaert

  • Reported in: P3.0 (26-Sep-06)
#25985
PDF page: 119
look at middle at page: We can now simplify the signin action to look like this: def signin if request.post? .... Now look at bottom of pa...more...
  • Reported in: P3.0 (05-Sep-06)
#25845
PDF page: 130
Halfway down the page, you have the simplified signin action. At the bottom of the page, you pring the the entire controller, but the signin method th...more...
  • Reported in: P3.0 (16-Aug-06)
#25730
PDF page: 134

Your date route is spot-on, except for: "Defaulting to the current day" --Fred Alger

  • Reported in: P1.0 (24-Jul-08)
#33166
Paper page: 136
Don't know is this is Rails 2.x specific, but self.password_salt, self.password_hash = salt, Digest::SHA256.hexdigest(pass+salt) should be self[:passw...more...
  • Reported in: P3.0 (02-Oct-06)
#26065
Paper page: 139

"if request.post?" is missing in the signin action of the full AdminController code listing (the last code piece on the page).--Hans-Eric Gr

  • Reported in: P3.0 (30-Oct-06)
#26436
PDF page: 140
model_class = Object.const_get(table.classify) should be model_class = Object.const_get(table.to_s.classify) Otherwise you get an error NoMethodEr...more...
  • Reported in: P3.0 (05-Feb-08)
#30703
Paper page: 142
At least using Rails 2.0.2, I get an "unknown table roles_users" message when I run this recipe. I had to add a new migration to rename roles_users to...more...
  • Reported in: P3.0 (30-Jul-07)
#29374
Paper page: 146
Please give page numbers on ALL pages; not putting page numbers on blank pages and on the receipe front pages means that you can go several pages with...more...
  • Reported in: P3.0 (30-Jul-07)
#29372
Paper page: 149

In the description of the solution, you say that you will use an "after_filter", but then you actually implement a before_filter.--Jon Seidel

  • Reported in: P3.0 (30-Jul-07)
#29373
Paper page: 149
The calculation in def session_expiry: @time_left = (session[:expires_at] - Time.now).to_i fails with the following error message: NoMethodErro...more...
  • Reported in: P3.0 (17-Mar-08)
#31258
Paper page: 150
session_expiry() doesn't invoke the RJS template, this is the error it produces: You called render with invalid options : /application/redirect --...more...
  • Reported in: B1.0 (04-Apr-07)
#28338
Paper page: 151

Render CSV

Example code gives error: NameError in ExportController#orders

Need to add require "CSV"

  • Reported in: P1.0 (20-Dec-06)
#26771
Paper page: 155

Mild grammatical : "We have multiple ways to achieve this affect, ..."

should that be "effect" ?
--John Simmonds

  • Reported in: P3.0 (12-Mar-07)
#27556
PDF page: 173
The setup() method suggested doesn't appear to work with current Rails (1.2) -- namely the last line. An update to this recipe would be nice in futur...more...
  • Reported in: P3.0 (09-May-07)
#28969
PDF page: 197
It would seem to me that Recipe 49: "Dealing with Time Zones" ignores daylight saving time. To have that included would be immensely helpful!--Sebas...more...
  • Reported in: P3.0 (18-Jul-07)
#29337
PDF page: 198
The @headers instance variable is deprecated in Rails 1.2. Instead, simply remove the "@" symbol so that the headers setter method is called. --Trevo...more...
  • Reported in: P3.0 (18-Jul-07)
#29336
PDF page: 199
If you get an error when calling CGI.rfc1123_date saying "undefined method `gmtime'", you are probably passing a Date object (instead of the required ...more...
  • Reported in: P1.0 (10-Sep-07)
#29645
PDF page: 219

Image#save_fullsize should be using write, not puts to write out the binary data.--Ryan Davis

  • Reported in: P3.0 (10-Sep-07)
#29646
PDF page: 228
I couldn't find this is the errata. In recipe 57 "Processing Uploaded Images", in Image#save_fullsize, you should be using write, not puts.--Ryan Davi...more...
  • Reported in: P1.0 (20-May-06)
#24933
PDF page: 234
Globalization example does not work. Since I'm still waiting for the printed book and have no access to the beta, I'm referering to the excerpt (so...more...
  • Reported in: P3.0 (02-Mar-09)
#38079
Paper page: 243
In the example "SecretURLs/app/models/inbox.rb" the line @attributes['access_key'] = MD5.hexdigest((object_id + rand(255)).to_s) should read ...more...
  • Reported in: P1.0 (25-May-06)
#25048
PDF page: 254
It seems that if you call the view for the HTML part "multipart_alternative", as is suggested in the manual, Rails will use this as the first part of ...more...
  • Reported in: P3.0 (04-Jul-07)
#29302
PDF page: 272
It should be more clear than "The default generated model, Delivery, is sufficient for our needs on the Ruby side of the house." that the reader shoul...more...
  • Reported in: P3.0 (24-Oct-06)
#26366
PDF page: 276

Appendix A - 'tis' should be 'this'--Brian Riggs

  • Reported in: P1.0 (22-Aug-06)
#25770
Paper page: 283
The code in the book for whitelists doesn't work. But the new code posted in the resources section: http://fora.pragprog.com/rails-recipes/posts/sh...more...
  • Reported in: P3.0 (02-Jun-07)
#29185
PDF page: 287
Paper page: 321

A small error in the first sentence in paragraph A.2:

The source code in tis book...

Maybe right: The source code in this book...--Dave

  • Reported in: P2.0 (05-Mar-07)
#27273
Paper page: 296
The code from notifier.rb as it stands doesn't work in the latest version of Rails because Rails automagically inserts the contents of multipart_alter...more...

Stuff To Be Considered in the Next Edition

  • Reported in: B1.3 (08-Apr-06)
#24427
PDF page: 1
For the section on html email. I saw in your source files that you do not have a css file or any images included. A slightly more advanced example wil...more...
  • Reported in: P1.0 (23-Jun-06)
#25325
PDF page: 6
Since you make a note stating to write your own actions for in-place edits, it would be nice to see at least one sample one. I'm having trouble locati...more...
  • Reported in: B1.5 (14-May-06)
#24855
PDF page: 15
Hi Using innerHTML here to add options to a select box won't work in, for example, IE6/win. I would recommend adapting the recipe to use the new...more...
  • Reported in: B1.5 (08-May-06)
#24788
PDF page: 31
I suggest adding a Discussion entry to this recipe to explain why lists were used instead of tables. Due to browser incompatibilities sorting in tabl...more...
  • Reported in: B1.5 (21-Apr-06)
#24515
PDF page: 51
A suggestion for the discussion section of recipe 12 (Creating a custom form builder): In this section you mention meta-programming in Ruby and show s...more...
  • Reported in: B1.5 (29-Apr-06)
#24553
PDF page: 77
I'd like to see included in this recipe how one would prevent a person from adding oneself as a friend. For example, if Chad were to become a friend o...more...
  • Reported in: B1.2 (09-Mar-06)
#24257
PDF page: 90
Recipe Suggestion: How to use LDAP/Active Directory for authentication only - integrate LDAP into Recipe 15 (Authentication) but also have it play ni...more...
  • Reported in: B1.1 (21-Feb-06)
#24163
PDF page: 143
Near the bottom of the page, "|procmail" in an italic font makes the "|" look like a "/". (Dave says: tricky to deal with this. Let me think about ...more...
  • Reported in: P1.0 (25-May-06)
#25029
PDF page: 264
As the default behaviour of Rails in test mode is to append Email to an array, not actually send it, it might be an idea to briefly cover Email Config...more...
  • Reported in: B1.5 (02-May-06)
#24575
PDF page: 268
Unfortunately the method described for graceful degradation of emails will not work for certain handheld devices, including the Blackberry's direct em...more...
  • Reported in: B1.5 (06-May-06)
#24769
PDF page: 281
Your example only produces a plain text e-mail. What if the user wants to send either an HTML email or a multipart/alternative email along with the at...more...