small medium large xlarge

Errata for Agile Web Development with Rails (2nd edition)

 

The latest version of the book is P5.0, released almost 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: P5.0 (31-Jan-08)
#30652
PDF page: 35
Now that Rails 2 is out, you might want to add a note on how to install the Rails 1.x version, so that the examples work. eg on Ubuntu (install prere...more...
  • Reported in: P5.0 (29-Nov-07)
#29937
PDF page: 35

The link to Duncan's OSX install write-up appears to be broken. It does, however, lead to a nice picture of his alpine mountaineering.--Dave Peck

  • Reported in: P5.0 (06-Feb-08)
#30706
PDF page: 35

New description of Mac OS X install at:
hivelogic.com/articles/ruby-rails-mongrel-mysql-osx/--Chris Baker

  • Reported in: P4.0 (31-Oct-07)
#29811
PDF page: 54
We can update Rails for each project with the 'gem update rails --include-dependencies' command. 'gem cleanup' then removes the old version. Runn...more...
  • Reported in: P5.0 (21-Mar-08)
#31412
Paper page: 59
Rails 2 by default use sqlite instead of MySQL. If you want to create the rails application using MySQLas discussed in the book, it should be done thu...more...
  • Reported in: P5.0 (11-Feb-08)
#30734
Paper page: 60
Middle of the page says "...you can skip forward to Section 6.1.." But I am in section 6.1 ... I think it means to say, skip the database configuratio...more...
  • Reported in: P4.0 (05-Oct-08)
#34875
Paper page: 66
Book has: Edit the file so that it looks like the following: depot_a/db/migrate/001_create_products.rb Should be: Edit the file so that it l...more...
  • Reported in: P5.0 (23-Mar-08)
#31429
Paper page: 67
undefined method `scaffold' for AdminController:Class I'm using a newer version of rails, than that used in the book. I'm sure that this is the rea...more...
  • Reported in: P5.0 (21-Jul-11)
#47301
PDF page: 78

tablewhose => table whose--Bernd Brägelmann

  • Reported in: P5.0 (01-Jul-08)
#32581
PDF page: 80

you have to edit three files

should read:

you have to edit four files
--Michael Rogers

  • Reported in: P5.0 (02-Apr-11)
#46724
PDF page: 80

SUBJ2--<a href=http://www.autoglass-job.ru>наклейки на автомобиль купить</a>

  • Reported in: P5.0 (03-Dec-07)
#29943
Paper page: 80
the download snippet, in the middle of the page, is shown as: depot_b/app/views/layouts/admin.rhtml it should be, in order to get the <!DOCTYP...more...
  • Reported in: P4.0 (03-Dec-07)
  • Fixed in: B1.02
#29945
PDF page: 80
Paper page: 71
== AddPrice: migrating ======================================================== -- add_column(:products, :price, :decimal, {:default=>0, :precision=>...more...
  • Reported in: P5.0 (29-Jun-08)
#32539
Paper page: 81
With my setup (Debian testing, Ruby 1.8, Rails 1.2.3) the truncate helper method returns noMethodError for length. (!) I believe this is an error i...more...
  • Reported in: P2.01 (03-Mar-08)
#31113
Paper page: 93
The second bullet point in the playtime section on this page asks the reader to make the image into a link that adds the book to the cart. However you...more...
  • Reported in: P5.0 (17-Jan-09)
#37108
Paper page: 94

The Play Time URL at the bottom of the page doesn't lead anywhere. (can't include the URL here because of form restrictions)--Matt Pounsett

  • Reported in: P2.0 (17-Jan-08)
  • Fixed: 29-Oct-08, awaiting book release
#30506
PDF page: 96
* I am a newbie, so this might be wrong. I just would like to report it and confirm whether my point is right or not in the code snippet of depot_...more...
  • Reported in: P5.0 (14-Jan-09)
#37045
Paper page: 99
Footnote 2 on p. 99 reads as follows: "Saying :id=>product is idiomatic shorthand for :id=>product.id. Both pass the product's id back to the controll...more...
  • Reported in: P4.0 (23-Dec-07)
#30152
Paper page: 101
The listing for "depot_q/app/views/login/list_users.rhtml" omits the <div> tags that should enclose the snippet. The "List users" link in Iteration F...more...
  • Reported in: P2.0 (16-Apr-08)
  • Fixed: 29-Oct-08, awaiting book release
#31677
Paper page: 111
hello, i think that the logic of Total price in Shopping Cart is wrong. You have it wrong on the picture on same page too: Total price should be ca...more...
  • Reported in: P5.0 (13-Apr-15)
#78314
PDF page: 111

Another test--Dave Thomas

  • Reported in: P4.0 (06-Oct-07)
#29752
PDF page: 117
even with these changes if you manually enter an invalid product id url where the product id starts with a valid id (e.g. ...add_to_cart/4fffff where ...more...
  • Reported in: P1.00 (26-Mar-08)
#31477
Paper page: 121
The first time javascript works (with ONE line?!? of code), we sort of hove to take your word for it. After all, reloading the index is likely to almo...more...
  • Reported in: P5.0 (13-Apr-15)
#78313
PDF page: 123

test of slack integration--Dave Thomas

  • Reported in: P5.0 (25-Apr-08)
#31731
Paper page: 124
The highlight function does not work when adding the first of a product type to the cart. I.E. 'Book A' has no entry in the cart. When I click add to ...more...
  • Reported in: P5.0 (07-Jul-08)
#32673
PDF page: 129
Paper page: 116
The Ajax Magic does not work with the given .rjs file specified. It gives an 'RJS Error'. The code in the .rjs file should be 'page.replace_html("cart...more...
  • Reported in: P4.0 (17-Aug-07)
#29439
PDF page: 130
if you are having problems with the AJAX, make sure you are clicking the button and not the hyperlinked image (made via a link_to in a previous 'extra...more...
  • Reported in: P5.0 (12-Dec-07)
#29982
PDF page: 141
The create script needs to remove the constraints prior to drop_table: class CreatePropagationRecords < ActiveRecord::Migration def self.up ...more...
  • Reported in: P5.0 (11-Jul-08)
#33031
Paper page: 152
Please ignore (or delete) entries #33004 and #33005 below. In the beginning of the tutorial, it shows how to create a 'admin' controller for the 'pro...more...
  • Reported in: P1.00 (10-Jul-08)
#33004
Paper page: 153

Line 2 in the listing is referring to a new layout file, but the book text does not describe how to create this file.--Eivind Hagen

  • Reported in: P1.00 (10-Jul-08)
#33005
Paper page: 158
Text refers to file admin_controller.rb but there is no instructions for actually creating this controller. This ties back to the missing "admin" layo...more...
  • Reported in: P5.0 (11-Jun-08)
#32360
PDF page: 166
Paper page: 158

source code doesn't include authorize method code.--Sonia Hamilton

  • Reported in: P5.0 (19-Apr-08)
#31684
PDF page: 172
Book reads "(In fact, this code still has a potential timing issue—it is still possible for two administrators each to delete the last two users if th...more...
  • Reported in: P4.0 (27-Jan-08)
#30584
Paper page: 180
The test will not run correctly because a number of fields in the 'line_items' table are defined to be NOT NULL. Therefore the default fixture file wi...more...
  • Reported in: P2.0 (06-Dec-07)
#29948
Paper page: 181
The file listed in the snippet 'depot_r/test/unit/product_test.rb' needs the portion starting from 'def test_positive_price' to second 'end' at the bo...more...
  • Reported in: P2.0 (11-Nov-07)
  • Fixed in: B1.02
#29867
Paper page: 193
At the bottom of the page We'll call the user "dave." should read We'll call the user "dave". The dot and quotation mark are swapped. ...more...
  • Reported in: P5.0 (27-Feb-09)
#38017
PDF page: 198
The set_locale method in application.rb is missing a "/" in assigning the locale_path. locale_path = "#{#LOCALES_DIRECTORY}#{I18n.locale}.yml" s...more...
  • Reported in: P5.0 (20-Jan-09)
#37164
Paper page: 209
The book says "The integration test facility is very nice: we know of no other framework that offers built-in testing at this high of a level." Better...more...
  • Reported in: P5.0 (16-Feb-09)
#37773
PDF page: 213
The line "xml_http_request "/store/add_to_cart", :id => ruby_book.id " differs from actual code: " xml_http_request :put, "/store/add_to_cart", :id =...more...
  • Reported in: P5.0 (27-Dec-07)
#30259
PDF page: 215
Running user_stories_test.rb, as supplied gives me: NoMethodError: undefined method `[]' for :put:Symbol Changing :put to 'put' results in a fai...more...
  • Reported in: P5.0 (18-Dec-07)
#30040
PDF page: 222

depot/test/performance/order_speed_test.rb: DAVES_DETAILS is missing.--Richard A Noble

  • Reported in: P5.0 (13-Apr-15)
#78315
PDF page: 222

Third one--Dave Thomas

  • Reported in: P4.0 (06-Nov-07)
#29837
PDF page: 265
"Anatomy of a Migration" Migration file names must match migration class names. If they don't match, the error shown is 'uninitialized constant' whic...more...
  • Reported in: P2.01 (18-Aug-07)
#29448
PDF page: 267

Hi!

You should include ":interval" type... it seems to be supported as a data type on migrations. I just used it in one of my projects.

  • Reported in: P4.0 (17-Sep-07)
#29670
PDF page: 268
The footnote states, "simply make it a datetime and name it created_at", but the majority of the book has "timestamp" -- do a search on "created_at". ...more...
  • Reported in: P2.0 (12-Mar-08)
#31229
Paper page: 273
Well, I'm using Rails 2.0, so this may be what has the error rather than your book, but I'll lay the whole thing out. When I execute the "ruby script...more...
  • Reported in: P5.0 (14-Feb-08)
#30753
PDF page: 274

Rather than suggesting that join tables don't need primary keys, you might suggest that they use the FK fields together as a composite PK.--Roy Pardee

  • Reported in: P5.0 (10-Nov-07)
#29864
PDF page: 283
Suggestion: On code in the bottom of the page change line: require_gem "activerecord" to require 'active_record' Details: "re...more...
  • Reported in: P2.0 (12-Nov-07)
#29875
PDF page: 283

The link to the subversion repository for annotate_models is not valid anymore.
--Joakim

  • Reported in: P4.0 (06-Oct-07)
#29753
PDF page: 291
The name of the driver and adapter has been changed to ibm_db since now the same driver/adapter can be used with both Informix and DB2 databases--Mana...more...
  • Reported in: P5.0 (28-Apr-08)
#31789
PDF page: 293
Regarding the Oracle adapter: it's perhaps worth a footnote that Oracle itself behaves very differently from standard SQL with regard to empty string ...more...
  • Reported in: P5.0 (16-May-08)
#32024
PDF page: 303

As a Rails n00b, it would be good to know WHY the first example on the page is "incredibly bad Rails code".--Jared Robertson

  • Reported in: P5.0 (09-Nov-07)
#29861
PDF page: 319

def last_five
@list.join(',' )
end
Is the method name list instead?--Nasir Khan

  • Reported in: P5.0 (15-May-08)
#32017
PDF page: 333
Follow up to the fix to the :finder_sql statement -- the text should also be clarified. "you can create a collection of all the line items for a parti...more...
  • Reported in: P5.0 (29-Feb-08)
#31068
PDF page: 333
Your finder_sql returns all rails line items (whether or not associated with your order) I suggest you change to : :finder_sql => "select l.* from l...more...
  • Reported in: P5.0 (29-Feb-08)
#31069
PDF page: 333
Precision to my previous recommandation : make sure the #{id} is between single quotes, otherwise it will be interpolated to early given a wrong value...more...
  • Reported in: P5.0 (18-Sep-08)
#34531
PDF page: 353
When doing self-referential joins, the :foreign_key of the has_many should refer to the primary key id field of the table. For example, ' has_many :ma...more...
  • Reported in: B1.11 (18-Sep-08)
#34545
PDF page: 353
A correction to the previous correction :-) If we had: class Employee < ActiveRecord::Base self.primary_key = "employee_id" then the belon...more...
  • Reported in: P2.0 (29-Feb-08)
#31079
PDF page: 359

Last sentence of before section 18.7: "... and add the column catgories_count to your table." -> missing e in cat*e*gories_count.--Irfan Adilovic

  • Reported in: P4.0 (26-Oct-07)
#29794
PDF page: 368
The documentation for validates_format_of says that it has an ':allow_nil' option, but this doesn't seem to be the case (it isn't mentioned in the onl...more...
  • Reported in: P5.0 (04-Dec-07)
#29946
PDF page: 393
Near the bottom of the PDF pages, the "default" routes.rb file is described. There appears to be a line of ruby missing: map.connect ':controlle...more...
  • Reported in: P5.0 (21-Mar-08)
#31420
PDF page: 411

The 'scaffold_resource' generator is no longer valid. The standard 'scaffold' generator will now do the same job.--Navin Samuel

  • Reported in: P1.00 (14-Nov-07)
#29883
Paper page: 421

It says, "The default parameter is unused." I think it's the "defaults" parameter.--Shannon -jj Behrens

  • Reported in: P5.0 (25-Feb-09)
#37965
Paper page: 438
The word "to-level" should be "top-level" in the sentence "Every new Rails application... a declaration such as the following is added to the to-level...more...
  • Reported in: P5.0 (03-Mar-08)
#31108
PDF page: 439

"... a declaration such as the following is added to the to-level application controller..." "to-level" should be "top-level" --Kiyu Gabriel

  • Reported in: P5.0 (17-Jan-08)
#30504
PDF page: 442

In the middle of the page the "particular controller" RssController will unlikely subclass ActionController::Base but ApplicationController.

  • Reported in: P2.0 (01-Mar-08)
#31096
PDF page: 455
Explanation of the :method parameter to "verify": "The request method (:get, :post, :head, or :delete) must match one of the given symbols." It seems ...more...
  • Reported in: P5.0 (06-Dec-08)
#36327
PDF page: 459
At the bottom of the page, the text says to put sweeper code into app/sweepers. This is incorrect; unless you configure your rails app otherwise, swee...more...
  • Reported in: P4.0 (10-Nov-07)
#29865
PDF page: 461
Minor error in the Time-Based Expiry of Cached Pages section. A sentence reads in part: the page cache file for content/show/1 will be in app/publ...more...
  • Reported in: P5.0 (29-Nov-07)
#29936
PDF page: 474
In Rails 1.2.6, I noted the following differences regarding TextHelper functions: truncate() takes a 4th optionnal argument: truncate_string = "......more...
  • Reported in: P2.0 (02-Mar-08)
#31105
PDF page: 483

First sentence of 22.5: "A form that wraps a single Active Record module...", should probably be "model" instead of "module".--Irfan Adilovic

  • Reported in: P2.0 (02-Mar-08)
#31106
PDF page: 492

Second paragraph, last line: ancilliary -> ancillary--Irfan Adilovic

  • Reported in: P5.0 (19-Nov-08)
#35977
Paper page: 498

In gray box "Forms Containing Collections", should the call on line 3 of the code be text_field() or text_field_tag()?

  • Reported in: P5.0 (17-Feb-08)
#30913
Paper page: 503

In order to retrieve the uploaded_picture name you call "picture_field.original_filename" but original_filename is not defined for Picture.--Sig

  • Reported in: P5.0 (24-Feb-09)
#37923
Paper page: 506

Footnote 11 should say "in place of" rather than "in place for".--Alan Frankel

  • Reported in: P5.0 (25-Feb-09)
#37957
Paper page: 525
The last instance of the word "in" should be changed to "it" in "It turns out that in our example code... so rather than including it on every page, w...more...
  • Reported in: P5.0 (28-Nov-07)
#29934
PDF page: 526

For "conditions_by_like" if would be useful to have a note about the side bar.--Dale Thatcher

  • Reported in: P5.0 (12-Jan-08)
#30456
Paper page: 526
Paging is broken if you utilize the search. Results come back fine initially, however when you page next or select a different page (while using the ...more...
  • Reported in: P4.0 (07-Oct-07)
#29756
PDF page: 534
in the example given for "periodically_call_remote" the third line is a condition where .innerHTML == "Unknown" which will cause this supposedly perio...more...
  • Reported in: P2.0 (03-Mar-08)
#31114
PDF page: 535
Though identical to the link_to_remote example two pages before, the periodically_call_remote example on this page is not specifically meaningful when...more...
  • Reported in: P1.0 (14-Nov-07)
#29878
Paper page: 537
At the bottom of the page, the code says, "<%= submit_to_remote 'Send Email', 'send'..." Those parameters are reversed. In fact, on the next page, t...more...
  • Reported in: P4.0 (01-Nov-07)
#29817
PDF page: 543
The code presented in this page 'auto_complete_demo.rhtml' does work in Safari, but not in Mozilla based browser like FireFox or Camino. Additionally,...more...
  • Reported in: P4.0 (07-Oct-07)
#29758
PDF page: 545
under "auto_complete_field options", in about the 2rd paragraph down, it says something about overriding the default server endpoint. this is in the ...more...
  • Reported in: P1.00 (14-Nov-07)
#29879
Paper page: 546
At the bottom of the page, it says, "as an HTML snippet containing just <li> elements." However, on the next page, the file "progforms/app/views/user...more...
  • Reported in: P1.00 (14-Nov-07)
#29880
PDF page: 549

It says "Figure 23.5: DRAG-AND-=DROP TO-DO LISTS". I think the "=" is a typo ;)--Shannon -jj Behrens

  • Reported in: P4.0 (17-Sep-07)
#29673
PDF page: 555
Within the inplace_demo.rhtml, the function 'user_columns' requires the relevance_extensions plugin; some mention of this dependency might be helpful-...more...
  • Reported in: P1.00 (14-Nov-07)
#29882
Paper page: 557

At the top of the page, it says "[No Value]", but if you look at the image on the bottom of p. 556, it says "[No Name]".--Shannon -jj Behrens

  • Reported in: P5.0 (05-Mar-08)
#31141
PDF page: 568
The example configuration for smtp server should be: config.action_mailer.smtp_settings = { ... rather than config.action_mailer.server_settings ...more...
  • Reported in: P5.0 (11-Jan-08)
#30444
PDF page: 610
I would suggest mentioning that in some circumstances the ssl_requirement plug-in will not be sufficient for security. e.g. if used for a 'login' act...more...
  • Reported in: P5.0 (15-Jan-08)
#30476
PDF page: 620
I found this section quite helpful in deploying my app, however in my case it didn't work using the recipe you gave. In Step Five on page 620 you giv...more...
  • Reported in: P5.0 (13-Jan-08)
#30465
PDF page: 621
# On the server(s) and your client (if not already installed) $ sudo gem install --include-dependencies ‘ $ sudo gem install --include-dependencie...more...
  • Reported in: P1.00 (24-Aug-07)
#29569
Paper page: 623

When setting up the deployment machine, the text says to install termios twice, once from MacPorts, and a second time from gem install.

  • Reported in: P5.0 (27-Nov-07)
#29928
PDF page: 623
Re Capistrano 2.0. Could an update include Dave's comment, so that one doesn't spend a lot of time trying to make something work that isn't going to?...more...
  • Reported in: P1.0 (27-Sep-07)
#29705
Paper page: 628
When rotating log files, it suggests that you "first copy the contents of the current log to a different file and then truncate it." This seems both ...more...
  • Reported in: P5.0 (18-Mar-08)
#31303
PDF page: 635

In line -6 "convenience" should be "convenient"--Matthew Cargo

  • Reported in: P4.0 (03-Oct-07)
#29745
PDF page: 709
In the index, Single Table Inheritance is listed as "Single-Table Inheritance", but in 2 other index entries, you're saying "see Single Table Inherita...more...

Stuff To Be Considered in the Next Edition

  • Reported in: P1.00 (23-Nov-06)
#26647
PDF page: 1
i would suggest to dedicate some pages to postgresql, which is by the way a fully SQL99 compliant database system (which mysql isnt.) -- postgresql an...more...
  • Reported in: P2.01 (02-Jul-07)
#29298
Paper page: 25
There is now a binary distribution for Linux called LinRails located at linrails.thembid.com that includes all the necessary tools to get started tha...more...
  • Reported in: P1.00 (24-Dec-06)
#26777
Paper page: 71
Got message trying to do rake db:migrate, saying "no such file /tmp/mysql.sock". Found fix on web, saying, change database.yml host from localhost to...more...
  • Reported in: P5.0 (12-Dec-07)
  • Fixed in: B1.02
#29980
PDF page: 76
It seems the scaffold :product does not work in Rails 2.0. A note or guidance for the equivalent would be very helpful. (Dave says: Rails 2 breaks...more...
  • Reported in: P4.0 (21-Sep-07)
#29691
Paper page: 89
The doctype declaration on page 89 is incorrect. The first 2 lines must be followed by the tag that says: (I had to replace the http with hxxp to subm...more...
  • Reported in: P1.0 (19-Nov-06)
#26609
PDF page: 218
The Integration Testing Support section opens with a description of the session object and a list of its attributes. It would be more instructive if t...more...
  • Reported in: P4.0 (10-Sep-07)
#29643
PDF page: 356
Trying to use the acts_as_list function, I have problems figuring out how to insert an item at a certain position in the list. I have found out that ...more...
  • Reported in: B1.12 (03-Oct-06)
#26066
PDF page: 388

Would be nice to see a file upload example in rest.--maintheme

  • Reported in: B1.12 (03-Oct-06)
#26067
PDF page: 388

Would be nice to get some information about the cache module + rest.--maintheme

  • Reported in: P4.0 (29-Aug-07)
#29602
PDF page: 478

Now (with the next rails 2.0 in mind) it is better to use the rails will_paginate plugin to do pagination in rails. It is much powerful.--Skyblaze

  • Reported in: P5.0 (01-Dec-07)
  • Fixed in: B1.02
#29938
PDF page: 613

you shoud update the book with new capistrano 2

(Dave says: this would be a new edition)--Skyblaze

  • Reported in: P4.0 (10-Aug-07)
#29395
PDF page: 623
With Capistrano 2.0 out, it appears that the line "cap --apply-to /local/project/path [applicationname]" is out of date, perhaps it should just read "...more...
  • Reported in: P2.01 (06-Jul-07)
#29308
PDF page: 687
AR::Base#quote ( #quote_value in Edge/2.0) not listed in index. Should be either listed under "q" or under "Active Record" entries (Dave says: t...more...
  • Reported in: P1.0 (19-Nov-06)
#26613
PDF page: 700
"Legacy schema: see Database" in Index. This deserves a unified discussion of basic issues like set_primary_key, set_table_name, AR:Base.pluralize_ta...more...
  • Reported in: B1.04 (21-Jun-06)
#25312
PDF page: 999
I've been using the code found here: http://media.pragprog.com/titles/rails2/code/rails-code.tgz and I don't see any documentation comments in the cod...more...