Errata for Agile Web Development with Rails (4th edition)
We try to keep our books accurate, but sometimes mistakes creep in. This page lists the errors submitted by our astute readers. If you've found a new error, please submit it.
The latest version of the book is P2.2, released 4 months 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.
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| 0 |
#49281: 8.5, item 3, "Add a default_scope to the Product model to specify the order to list the items on the website."
The order of the list was sp...more...
|
P2.2
05-May-12 |
||
| 1 |
#48927: Have the entire code for a given chapter available with a link. I got to the end of a mid chapter and all the tests were broken. It is very ...more...
Sam Ruby says: http://pragprog.com/titles/rails4/source_code
|
P2.2
11-Mar-12 |
||
| 1 |
#49099: Could the report-erratum url in the pdf footer, be modified to contain the pdf page number?--Brian Maltzan |
P2.2
11-Apr-12 |
||
| 20 |
#48542: On the first sentence:
"At this point, we can see not only that have we connected ..."
should be:
"At this point, we can see not only...more...
|
P2.1
17-Jan-12 |
||
| 28 |
#49111: You need to use Ctrl + Pause/Break to stop the current application rather than Ctrl + C (at least on windows 7 anyway) cheers, Jon--Jonathan Oliver Hyde |
P2.2
14-Apr-12 |
||
| 31 |
#48875: It seems that every use of the [Add to Cart] button in the PDF version comes across in the mobi ebook version as "ADD ADD CART button" with at...more...
|
P2.2
03-Mar-12 |
||
| 37 |
#48617: On OSX Lion, use rvm install 1.9.3 --with-gcc=clang--Christopher Atkins |
P2.2
30-Jan-12 |
||
| 42 |
#48899: "... if it detects that you are running Rails 1.9.2 or later." should be "... if it detects that you are running Ruby 1.9.2 or later."--Keith Urry |
P2.2
05-Mar-12 |
||
| 42 |
#48567: “However, most developers seem to prefer the new syntax, and Rails will even generate scaffolds using the new syntax if it detects that you ar...more...
|
P2.2
23-Jan-12 |
||
| 46 |
#48790: Code from previous:
<%= link_to "Goodbye", say_goodbye_path %>!
but:
Let’s stop for a minute to consider how we generated the link. We...more...
|
P2.2
21-Feb-12 |
||
| 59 | 39 |
#48820: first paragraph, it reads ->"thing named,"<-, the comma and the last quotation mark are interchanged--indi |
P2.2
27-Feb-12 |
|
| 65 |
#49315: After db:migrate is run and navigating to localhost:3000/products:
Routing Error
No route matches [GET] "/products"
Try running rake ro...more...
|
P2.2
12-May-12 |
||
| 68 |
#48561: When I run rake test for the first time, I get 7 errors. Running 'rake db:test:prepare' and 'RAILS_ENV=test rake db:migrate' fixed the problem.--Jason Noble Sam Ruby says: Can't reproduce |
P2.2
22-Jan-12 |
||
| 75 |
#48560: depot> git config --file .gitconfig --list
git looks for .gitconfig in the current directory (depot) yielding:
fatal: unable to read confi...more...
|
P2.2
21-Jan-12 |
||
| 75 |
#48585: Christian-Doerings-MacBook-Pro:depot cdoering$ git config --file .gitconfig --list
fatal: unable to read config file '.gitconfig': No such fi...more...
|
P2.2
26-Jan-12 |
||
| 80 |
#48922: Provide instructions on how to avoid this up front (when running the "rake test" command for the first time). I am running the versions in th...more...
|
P2.2
09-Mar-12 |
||
| 82 |
#48974: After the "rails generate" and "rake db:migrate" commands, the public/stylesheets directory is not created. This causes a problem on page 92 (...more...
Sam Ruby says: If you are going to run with Rails 3.1 or later, you will need to get the version of the book that matches that release of Rails.
|
B12.0
22-Mar-12 |
||
| 83 |
#48562: The output of rake test:units looks different. (Is there a different test unit formatter we should be using?)
Jasons-iMac:depot jasonn$ ...more...
|
P2.2
22-Jan-12 |
||
| 85 |
#49168: In the book :
---------------
<div class="field">
<%= f.label :description %><br />
<%= f.text_area :description, rows: 6 %>
</div>
...more...
|
P2.2
21-Apr-12 |
||
| 85 |
#49226: I get a compiler error when changing the code:
|
P2.2
28-Apr-12 |
||
| 88 |
#48563: In testing the unique product using fixtures, why do we use assert !product.save instead of assert product.invalid? like we did on the other tests?--Jason Noble |
P2.2
22-Jan-12 |
||
| 95 |
#48932: /titles/rails4/code/rails32/depot_d/app/assets/stylesheets/store.css.scss
missing float: left in img definition.
For me working well smt...more...
|
P2.2
12-Mar-12 |
||
| 98 |
#48505: I trying to delete the content.but i showing display the content.the code is "<%= link_to 'Destroy', product,:confirm => 'Are you sure?',:meth...more...
|
P2.1
12-Jan-12 |
||
| 107 |
#49337: 9.2
It may be worth noting that attr_accessible :product is required in order to create() a LineItem.
class LineItem < ActiveRecord::B...more...
|
P2.2
17-May-12 |
||
| 110 |
#49180: in app/controllers/line_items_controller.rb#create, the third line gives the error:
ActiveModel::MassAssignmentSecurity::Error: Can't mass-...more...
|
P2.2
23-Apr-12 |
||
| 110 |
#49082: Chapter 9: The 3rd statement being added to the line_items_controller to build @line_item causes an MassAssignmentSecurity::Error in rails ver...more...
|
P2.1
07-Apr-12 |
||
| 110 |
#48893: The markers ">" are missing in the snippet from rails32/depot_f/app/assets/stylesheets/store.css.scss
Is:
p, div.price_line {
margin-l...more...
|
P2.2
05-Mar-12 |
||
| 112 |
#49053: we’ll ___tart___ it up in a minute--Brian Maltzan |
P2.2
04-Apr-12 |
||
| 112 |
#49054: why such a gap between creating the "current_cart" method and using it?--Brian Maltzan |
P2.2
04-Apr-12 |
||
| 112 |
#49325: Functional tests failing with MassAssignementSecurity::Error. Fixed by adding the following:
to product.rb:
attr_accessible :product_id, ...more...
|
P2.2
13-May-12 |
||
| 112 |
#49118: When running rake test:functionals, even using the sample code, the following error occurs:
test_should_create_line_item(LineItemsControl...more...
|
P2.2
16-Apr-12 |
||
| 117 |
#49083: In the migration method 'up', where we create a replacement item, the migration gets an error when rake db:migrate is run: "Can't mass assign ...more...
|
P2.1
08-Apr-12 |
||
| 118 |
#49186: After building the up-migrate it fails with "Can't mass-assign protected attributes: quantity" until :quantity is added to LineItem model's at...more...
|
P2.2
24-Apr-12 |
||
| 120 | 101 |
#48519: Might be wrong - but the final asset test's regular expression wasn't checking out with my tests... I checked and I have the most updated rail...more...
|
P2.1
13-Jan-12 |
|
| 126 |
#48644: At the end of the page (6 lines from the bottom):
should be: .total_line, .total_cell {
|
P2.2
02-Feb-12 |
||
| 128 | 110 |
#49279: I experienced the same MassAssignmentSecurity::Error reported by Terry and David. Terry's solution caused this error:
undefined local vari...more...
|
P2.2
04-May-12 |
|
| 129 |
#49072: The CSS example at [p. 129.9] in depot_i/public/stylesheets/depot.css
doesn't match (media-origin.pragprog.com/titles/rails4/code/rails30/dep...more...
|
P1.0
06-Apr-12 |
||
| 135 |
#49227: On page 135 of 737 in iBooks, there should not be a "\" in the following command:
rails generate scaffold Product \ title:string descriptio...more...
|
P2.2
28-Apr-12 |
||
| 142 |
#48642: Not sure about this, but in the following quoted paragraph:
"See how we identified the browser element that we wanted to apply the effect
to...more...
|
P2.2
02-Feb-12 |
||
| 143 |
#48816: In the modifications to depot_n/app/views/line_items/create.js.erb, $('#cart tr').length will never equal 1 due to the <tr> which includes the...more...
|
P2.2
26-Feb-12 |
||
| 146 |
#49071: Iteration F3: Highlighting changes
Just asking user to animate a background, which doesn't seem to be possible without jquery.color.js whic...more...
|
P2.2
06-Apr-12 |
||
| 150 |
#48928: At some point in Chapter 11, all indexes broke, because the side bar expects @cart to be set. Unless I missed where this must be added (e.g. ...more...
|
P2.2
11-Mar-12 |
||
| 167 |
#48930: The following (code sample) link is broken: feed://media.pragprog.com/titles/rails4/code/rails32/depot_p/app/views/products/who_bought.atom.builder--Paul J Solomon |
P2.2
12-Mar-12 |
||
| 174 |
#48671: Figure 27 on chapter 12 shows links to Orders, Products and Users on the sidebar, but those links aren't added until chapter 14. Figure needs ...more...
|
P2.2
06-Feb-12 |
||
| 190 |
#49073: On [p. 190.6] it says "Create User", and if I code what the code
says, that's indeed what it says. However, in the picture on [p. 191],
it ...more...
|
P1.0
06-Apr-12 |
||
| 190 |
#49074: [p. 190] Why does this form use ":" after each field label? It
doesn't match the other forms, and it looks ugly and broken if there are
for...more...
|
P2.2
06-Apr-12 |
||
| 199 |
#48931: FYI: The commented version of the bcrypt gem line does not exist in my Gemfile: gem 'bcrypt-ruby', '~> 3.0.0'--Paul J Solomon |
P2.2
12-Mar-12 |
||
| 220 |
#48654: It says that labels don't need explicit translations. This does not seem to work for rails 3.2.1. The name and email labels are just displayin...more...
|
P2.2
04-Feb-12 |
||
| 227 |
#49002: Change marker(s) for store_controller.rb is wrong.
line "@cart = current_cart" is not changed only indented, but marked as changed (>).
if...more...
|
P2.2
28-Mar-12 |
||
| 241 |
#48565: It appears the "proper" way to deploy with bundler, is to include the line
'require "Bundler/capistrano"'
in the deploy.rb file. Then t...more...
|
P2.2
22-Jan-12 |
||
| 250 |
#48506: I think the mysql database should be created with utf8 encoding, i.e:
|
P2.1
12-Jan-12 |
||
| 254 |
#49075: At [p. 254.7] who_bought.atom.builder is in products, not layouts.--Shannon -jj Behrens |
P1.0
06-Apr-12 |
||
| 255 |
#48682: In database.yml configuration for production environment adapter for database is set to 'mysql'. However, as we are using 'mysql2' in our Gemf...more...
|
P2.2
08-Feb-12 |
||
| 262 |
#49097: missing space:
|
P2.2
11-Apr-12 |
||
| 300 |
#49157: The ciphered mail corresponds to pragprog.com and not example.com as it should be--Jose Antonio Gonzalez |
P2.2
20-Apr-12 |
||
| 315 | 298 |
#49275: # We're passed a list of attributes that should
|
P2.2
03-May-12 |
|
| 348 |
#48556: (Same as #47950) Samples on chapter 21.4 are totally rails2 way.--Youhei Kondou |
P2.2
20-Jan-12 |
||
| 364 |
#49362: Please verify this...
The book says:
Idiomatic Rails developers use a variable named after the template (article in this instance). In fac...more...
|
P2.2
22-May-12 |
||
| 395 |
#48598: The syntax for specifying a non-NULL column appears to have changed (it does not work for me under Rails 3.1.3). The books shows, for example...more...
Dave Thomas says: David: The book uses Ruby 1.9, which supports the more compact syntax for hashes. We strongly recommend making the switch.
|
P2.2
26-Jan-12 |
||
| 399 |
#48599: To create a table x without an x_id primary key column I had to use "create table :x, :id => false do ..." instead of with "id: false" as shown.--David Hull |
P2.2
27-Jan-12 |
||
| 444 | 431 |
#48859: "If you run the rails --tasks" -> "If you run the rake --tasks"--anonymous |
P2.2
01-Mar-12 |
|
| 450 |
#48557: Index contains set_primary_key method which doesn't appear anywhere in the book (which is good since this method is deprecated since rails 3.2...more...
|
P2.2
21-Jan-12 |
Stuff To Be Considered in the Next Edition
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| all |
#47945: It would be convenient if the page numbers could be synchronized such that they are always along the outside edge of the page. Some chapters s...more...
|
P2.1
13-Nov-11 |
||
| 98 |
#47642: Why don't you teach to use flash standard messages by adding lines like those in the application template?
<% flash.each do |key, value| %>...more...
|
P2.0
26-Sep-11 |
||
| 211 |
#48213: "Note that we did not choose to put the administrative and session functions inside this scope, because it is not our intent to translate them...more...
|
P2.1
05-Dec-11 |
