Thanks for contributing an erratum for Agile Web Development with Rails.

If your erratum concerns code in the book that doesn't work for you, you might want to check that you're running the same version of software used in the book.

Existing Errata

The following errata have already been reported for this page.

  • in the listing for list.rhtml, the line to destroy an entry is written like this: <%= link_to 'Destroy', { :action => 'destroy', :id => product }, :confirm => "Are you sure?" %> This doesn't work. I think it should be (going by the default scaffolding created by rails) like this: <%= link_to 'Destroy', { :action => 'destroy', :id => product }, :confirm => 'Are you sure?', :post => true %> (Dave says: This is a change to scaffolding in 1.1.1. Fixed)

  • It's not immediately clear what the full URL for the images or for the depot.css file mentioned in the footnote is. In fact, I haven't been able to find the images yet.

  • It might be useful to clarify what %{} does.

  • In the code listing for depot_c/db/migrate/003_add_test_data.rb, the definition for self.down begins before self.up ends. In other words, it should read: # . . . end def self.down Product.delete_all end

  • When I did this, the scaffolding generated code using @products_pages not @product_pages (Dave says: Perhaps you typed 'products' on the command line?)

  • "If you refresh your browser, you should see no dif ference in the page that

  • I am not sure what version I have, although it is the newest one available. May I suggest steps on how to do a basic deployment to an live web server with re-deployment how-tos after each major Depot task? Your book is great at basic walk-throughs on how to build a site on one's desktop with Ruby, but nobody seems to cover deployment. And what good is it laying around on my desktop. I paid $50 for the book expecting that sort of information. I had already found free tutorials that covered the basic desktop app. (Dave says: perhaps the deployment chapter... ??)

  • I added the following to 002_add_price.rb: class AddPrice < ActiveRecord::Migration def self.up add_column :products, :price, :decimal, :precision => 8, :scale => 2, :default => 0 end def self.down remove_column :products, :price end end And then ran the rake db:migrate command. The error I got back was as follows. (in C:/temp/InstantRails/rails_apps/depot) == AddPrice: migrating ======================================================== -- add_column(:products, :price, :decimal, {:precision=>8, :scale=>2, :default=> 0}) rake aborted! You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] (See full trace by running task with --trace) Perhaps this is because I am running an earlier version of Rails. I downloaded InstantRails as per your instructions. It may be best to clarify that these statements may only work on vX.X of Rails, or whatever is necessary. (Dave says: the very first page of the book explains that you need to run Rails 1.2, and gives instructions on how to get it while we're waiting for the core team to produce it)

  • (in /Users/dave/Work/BS2/titles/RAILS2/Book/code/depot_a) should be (in /Users/dave/work/depot) from page 75

  • updated rails and still get the nil object error reported above. (Dave says: Have you tried it with code downloaded from the book's site?)

  • I get error when I run db:migrate for adding price to table products. == AddPrice: migrating ======================================================== -- add_column(:products, :price, :decimal, {:precision=>8, :scale=>2, :default=>0}) rake aborted! You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] I try to delete all my records from table, (ass sugested from one user here) but I get the same error. Then I change price field from decimal->integer (http://www.imarichardson.com/2006/10/01/agile-web-development-with-rails-code-fix/) and migration works. Is there an error in the book (pdf) or is there something else wrong? Could anybody please give me/us a proper explination. (Dave says: please upgrade to the newer Rails, as described on page 2 of the PDF (just after the cover)

  • after changing db/migrate/002_add_price.rb I run: user@host$ rake db:migrate i got this: == AddPrice: migrating ======================================================== -- add_column(:products, :price, :decimal, {:precision=>8, :default=>0, :scale=>2}) rake aborted! You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] (Dave says: you need a more recent version of Rails)

  • == AddPrice: migrating ======================================================== -- add_column(:products, :price, :decimal, {:default=>0, :precision=>8, :scale=>2}) rake aborted! You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] Above error on the following... Two different machines, both Nvidia based. AMD64 3000 and AMD64 6000 AM2. Kernels are i386, not AMD64. Cut and pasted code from website. Standard Debian Etch. Etch with all GEM updates applied (Rails 2.6, Ruby 1.8.5). Etch with all updates and kernel 2.6.18 or 2.6.22. Knoppix 5.0 with Gem updates. Kubuntu 7.10 with and without Gem updates. Apparently something in any Debian distro does not like rails. (Dave says: You need Rails 1.2)

  • you have to edit three files should read: you have to edit four files

Perhaps yours has already been spotted by someone else? If so, no need to enter it again :)

or

If you're reading a printed copy of the book, enter the printed page number containing the erratum in the "Paper Book" field. If you're reading a PDF, we're looking for the page number that appears on the page. For newer PDFs, this is the same as the absolute page number, but for older ones, you might find the numbers differ. For both PDF and paper, use Roman numbers if the page number is shown using Roman numbers.

Some context is handy

or Cancel