small medium large xlarge

Errata for Agile Web Development with Rails 3.2

 

The latest version of the book is P3.0, released over 3 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: P2.1 (13-Nov-11)
  • Fixed in: B2.0
#47945
PDF page: all
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 seem to p...more...
  • Reported in: B2.0 (01-May-13)
#51432
Paper page: 0
Errata error ... on pragprog.com/titles/rails4/errata it says The latest version of the book is P3.2, released about 3 hours ago. If ...more...
  • Reported in: B1.0 (06-Mar-13)
  • Fixed in: B2.0
#50965
PDF page: 5
The command used in the book reads as "rvm install 2.0.0", but this is causing an error saying the version is too confusing. What really helps is iss...more...
Sam Ruby says: I can't reproduce this and I haven't seen the problem reported elsewhere.
  • Reported in: B1.0 (03-Mar-13)
  • Fixed in: B2.0
#50948
PDF page: 11
Editor/IDE notes are outdated: RadRails is now effectively deprecated: "RadRails is now included as part of Aptana Studio 3" as per the footnote URL....more...
  • Reported in: B2.0 (01-May-13)
  • Fixed: 01-May-13, awaiting book release
#51431
Paper page: 13
re: Agile Web Development with Rails 3.2 (4th edition) ...more...
Sam Ruby says: I just tried these instructions on a fresh virtual machine with Rails 3.2.13: $ rake doc:rails rm -r doc/api Parsing sources... 100% [503/503] ...ant/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails.rb Generating Darkfish format into /home/vagrant/work/dummy_app/doc/api... Files: 503 Classes: 248 ( 123 undocumented) Modules: 276 ( 176 undocumented) Constants: 163 ( 143 undocumented) Attributes: 227 ( 215 undocumented) Methods: 2701 (1142 undocumented) Total: 3615 (1799 undocumented) 50.24% documented Elapsed: 58.4s
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50971
PDF page: 15

Mikel Lindsaar has changed the company name from RubyX to reInteractive--Trung LE

  • Reported in: P3.0 (06-Jan-13)
  • Fixed in: B1.0
#50441
PDF page: 16.2
For next edition, the chapter on deployment via Capistrano needs to be updated: - if you are using RVM, the first two lines in the RVM section of dep...more...
  • Reported in: P3.0 (07-Dec-12)
  • Fixed in: B1.0
#50327
PDF page: 19
Running Windows version Rails 3.2.1. When you attempt to run this new version it fails because of the asset pipeline support that was added, you need...more...
Sam Ruby says: Printing 3.0 is for Rails 3.2.3.
  • Reported in: B1.0 (27-Feb-13)
  • Fixed in: B2.0
#50911
PDF page: 20
"Some browsers (such as Safari) will mistakenly try to interpret some of the templates as HTML" - Safari 6.0.3 renders the Ruby code just fine. OS X 1...more...
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50972
PDF page: 28

My surname LE as in Trung LE is missing the accent, it should be Trung Lê--Trung Lê

  • Reported in: P3.0 (26-Feb-13)
  • Fixed in: B2.0
#50899
PDF page: 28
Assuming Ubuntu is one of the most popular Linux distribution. The upgrade command does not work on it. $ gem update --system ERROR: While execut...more...
Sam Ruby says: That was removed in the second printing.
  • Reported in: P3.0 (12-Nov-12)
  • Fixed in: B1.0
#50158
PDF page: 29

Installing on Mac:
sudo port install rb-rubygem
missing s on end - should read:
sudo port install rb-rubygems
--scott macri

Sam Ruby says: Could not find these instructions in any recent printing
  • Reported in: B1.0 (03-Mar-13)
  • Fixed in: B2.0
#50949
PDF page: 31
(Got page number wrong). Editor/IDE notes are outdated: RadRails is now effectively deprecated: "RadRails is now included as part of Aptana Studio ...more...
  • Reported in: P2.2 (03-Mar-12)
  • Fixed in: B2.0
#48875
PDF page: 31
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 least t...more...
  • Reported in: B1.0 (03-Mar-13)
  • Fixed in: B2.0
#50950
PDF page: 34

Remove reference to postgres-pr. It's undocumented, and hasn't been updated since Dec 2009.

  • Reported in: P3.0 (24-Aug-12)
  • Fixed in: B1.0
#49738
PDF page: 62
rails generate scaffold Product \ title:string description:text image_url:string price:decimal The \ only works in a Linux environment. It causes...more...
Sam Ruby says: I've retested it on a mac and verified it works. Windows is covered by the footnote.
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50979
PDF page: 64
For the paragraph on recommending installing Xcode 4.1 from App Store, I think we should mention that we just need to install Command Line Tools packa...more...
  • Reported in: P3.0 (23-Aug-12)
  • Fixed in: B1.0
#49727
PDF page: 65
In the image of the web viewer showing an empty product listing, the location field shows "localhost:3000/product". The "s" on the end of product has...more...
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50977
PDF page: 66
OSX 1.0.7+ is known to have issues with UTF-8 input within IRB due to a bug within libreadline that is shipped by default on the platform. The fix is ...more...
Sam Ruby says: Went with autolibs as the latest rvm states: Beware, 'rvm pkg ...' is deprecated, read about the new autolibs feature: 'rvm help autolibs'.
  • Reported in: P1.0 (22-Nov-12)
  • Fixed in: B1.0
#50192
Paper page: 70

for me the cycle method doesn´t work to create alternating background colors.--Adrian

  • Reported in: P3.0 (20-Jul-13)
#52222
PDF page: 71
<body class='<%= controller.controller_name %>'> didn't work But when I change it for: <body class="<%= controller.controller_name %>"> worked ...more...
  • Reported in: P2.2 (20-Jul-13)
#52223
PDF page: 71
<body class='<%= controller.controller_name %>'> didn't work But when I change it for: <body class="<%= controller.controller_name %>"> worked ...more...
  • Reported in: P3.0 (13-Dec-12)
  • Fixed in: B1.0
#50374
Paper page: 72

<table> should say <table class="products">

Sam Ruby says: class="products" is placed on the body element on the previous page
  • Reported in: B1.0 (28-Feb-13)
  • Fixed in: B2.0
#50918
PDF page: 72
The file products.css.scss has comments /* START_HIGHLIGHT */ and /* END_HIGHLIGHT */. This has the effect of creating an empty products.css file, an...more...
Sam Ruby says: Works for me with those comments in place (i.e., the generated products.css is not empty). If you see this comment, consider starting a discussion on http://forums.pragprog.com/forums/148 and we can debug this together.
  • Reported in: P3.0 (24-Dec-12)
  • Fixed in: B1.0
#50410
PDF page: 72

The page rails32/depot_a/app/views/products/index.html.erb linked to on page 72 displays the code in a table, instead of as html--DJH

Sam Ruby says: view source
  • Reported in: P2.2 (14-Jul-12)
  • Fixed in: B1.0
#49524
PDF page: 80
Validating `:image_url, presence: true`, makes the image_url field required. A few lines down, in the same model, `validates :image_url, allow_blank:...more...
Sam Ruby says: This is specifically called out in the prose: "Note that we used the allow_blank" option to avoid getting multiple error messages when the field is blank"
  • Reported in: P3.0 (04-Dec-12)
  • Fixed in: B1.0
#50247
Paper page: 81

Tests don't pass

Sam Ruby says: works for me
  • Reported in: P3.0 (23-Aug-12)
  • Fixed in: B1.0
#49729
PDF page: 84
In the paragraph after the 'test "product price must be positive" do' code, third sentence, you mention using the join method to concatenate the error...more...
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50973
PDF page: 85
Sublime Text Editor has gained much traction for the past years and has replaced the defacto TextMate. It's good if we could mention Sublime here.--Tr...more...
  • Reported in: P3.0 (30-Sep-12)
  • Fixed in: B1.0
#49901
PDF page: 88
the seed.rb uses rails.jpg for the product, and the file provided in media.pragprog.com/titles/rails4/code/rails32/depot_a/app/assets/images/ is a png...more...
Sam Ruby says: I can't find rails.jpg anyplace... the seeds file refers to cs, ruby, and rtp jpg files.
  • Reported in: P2.1 (30-Aug-12)
  • Fixed in: B1.0
#49768
Paper page: 92
# root :to => 'welcome#index' root to: => 'store#index', as: 'store' Has to be # root :to => 'welcome#index' root :to => 'store#index'...more...
Sam Ruby says: root to: 'store#index', as: 'store' is correct for Ruby 1.9.2
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50978
PDF page: 93

Please remove paragraph mentioning about postgres-pr library because that lib is very outdated and inactive--Trung Lê

  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50982
PDF page: 95
I think we should mention PostgresSQL in 'We installed (or upgraded) the SQLite 3 and MySQL databases' (page 95) and 'MySQL and SQLite adapters..." (...more...
Sam Ruby says: Added encouragement to explore postgresql as well as rbenv, ruby-build, unicorn, and nginx in the Playtime section of the Deployment chapter.
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50974
PDF page: 96

Please replace URL `rvm.beginrescueend.com/` with `rvm.io`--Trung Lê

  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50983
PDF page: 96

Please recursively search and replace URL rvm.beginrescueend.com with rvm.io--Trung Le

  • Reported in: B1.0 (10-Apr-13)
  • Fixed in: B2.0
#51260
PDF page: 96
There shouldn't be a "#" after the comma on line 5 for application.html.erb <!DOCTYPE html> <html> <head> <title>Pragprog Books Online Store</ti...more...
  • Reported in: B1.0 (01-Mar-13)
  • Fixed in: B2.0
#50926
PDF page: 96
Clicking on "Download rails40/depot_e/app/views/layouts/application.html.erb" does not open in the browser but instead jumps to PDF page 449 --James...more...
Sam Ruby says: Works for me in both Chrome and Firefox. Can you provide more information on what you are seeing? Meanwhile, the correct link is http://media.pragprog.com/titles/rails4/code/rails40/depot_e/app/views/layouts/application.html.erb
  • Reported in: P2.0 (26-Sep-11)
  • Fixed in: B1.0
#47642
PDF page: 98
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...
Sam Ruby says: After much thought, I decided to stick with something that is closer to the approach of the templates produced by the scaffolding generator.
  • Reported in: P3.0 (23-Aug-12)
  • Fixed in: B1.0
#49733
PDF page: 98
There appears to be a problem with the css for the img tag in the banner. When viewing the page in Safari 6.0, the logo image shows up on top of the ...more...
Sam Ruby says: check for #banner.img {float: left} in application.css
  • Reported in: P2.2 (12-Jul-12)
  • Fixed in: B1.0
#49515
PDF page: 98
'}' missing at the end of the #columns declaration (in the pdf AND on the page code/rails32/depot_e/app/assets/stylesheets/application.css.scss ) ...more...
Sam Ruby says: Double and triple checked. There are 9 open and 9 close braces in that file. #main and #side are nested within #columns. Inside #side, ul, li, and a are nested, which makes a total of five open elements that are closed at the end of the file.
  • Reported in: B1.0 (20-Apr-13)
  • Fixed in: B2.0
#51344
PDF page: 99

I believe Rails 4 is using the minitest framework now as it has replaced test unit in ruby 1.9+. The book still mentions test unit.--Peter Rhoades

  • Reported in: B1.0 (20-Mar-13)
  • Fixed in: B2.0
#51100
PDF page: 100
With Task B Validation and Unit Testing in Iteration B2. The directory structure in the project differs to what is described in the book. Where the b...more...
Sam Ruby says: It actually is the other way around: with test/unit and test:units are Rails 3.x and below; test/models and test:models is Rails 4.
  • Reported in: B1.0 (26-Apr-13)
  • Fixed in: B2.0
#51391
PDF page: 100
when adding this to my products_controller_test @update = { :title => 'Lorem Ipsum', :description => 'Wibbles are fun!', ...more...
Sam Ruby says: Works for me: http://intertwingly.net/projects/AWDwR4/checkdepot-193-32/section-7.1.html. Feel free to bring up on http://forums.pragprog.com/forums/148
  • Reported in: P3.0 (23-Aug-12)
  • Fixed in: B1.0
#49735
PDF page: 101
The formatting for this page appears to be wrong. After the sentence, "First, let’s take a look at what Rails generated for us:", the rest of the pag...more...
  • Reported in: P3.0 (12-Feb-13)
  • Fixed in: B1.0
#50789
PDF page: 104
In section 8.5, "What We Just Did," item 3 states: "Add a call to the order() method with the Products controller..." This call to order() was added ...more...
  • Reported in: B1.0 (01-Apr-13)
  • Fixed in: B2.0
#51167
PDF page: 107
Last test("...unique title - i18n") fails. --- expected +++ actual @@ -1 +1 @@ -"translation missing: en.activerecord.errors.messages.taken" +"ha...more...
Sam Ruby says: Should be errors.messages.taken (i.e., no activerecord): http://media.pragprog.com/titles/rails4/code/rails40/depot_c/test/models/product_test.rb Which passes: http://intertwingly.net/projects/AWDwR4/checkdepot/section-7.2.html
  • Reported in: B1.0 (27-Feb-13)
  • Fixed in: B2.0
#50913
PDF page: 108
"current_cart()..." in the first and second paragraphs should be changed to "set_cart()". "CreateCart module" in the second paragraph should be change...more...
  • Reported in: P3.0 (08-Nov-12)
  • Fixed in: B1.0
#50157
Paper page: 111
Minor nit, second paragraph: says that you pass the product into @cart.line_items.build, then save into an instance variable named @line_item. The...more...
  • Reported in: P3.0 (23-Aug-12)
  • Fixed in: B1.0
#49736
PDF page: 112
In the first sentence on the page, you mention adding the new css lines to the rule for .entry. However, the lines were added to the rule for price_l...more...
  • Reported in: P3.0 (02-Oct-12)
  • Fixed in: B1.0
#49905
PDF page: 112
@line_item = @cart.line_items.build should be: @line_item = @cart.line_items.build(:product_id => product.id) this even fix the AJAX problems...more...
  • Reported in: P2.2 (04-Jul-12)
  • Fixed in: B1.0
#49492
PDF page: 113
the image showing a double add of the "CoffeeScript" title is wrong. It should just be one, despite a refresh (because you're simply refreshing the CA...more...
  • Reported in: P3.0 (24-Jan-13)
  • Fixed in: B1.0
#50519
PDF page: 115
The book says to rename application.css to application.css.scss. Previously when told to delete public/index.html, the book also listed the Git comman...more...
  • Reported in: P2.2 (20-Jul-13)
#52221
PDF page: 116

Missing the line "@line_item.product = product" in the controller. Add after the line "@line_item = @cart.add_product(product.id)"--Matías Mascazzini

  • Reported in: P2.2 (11-Oct-12)
  • Fixed in: B1.0
#49941
PDF page: 118
related to erratum #49593 When applying the migration: depot> rake db:migrate the following error occurs: "Can't mass assign protected attribu...more...
Sam Ruby says: Printing 3.0 is required in order to use Rails 3.2.3 or later.
  • Reported in: P3.0 (23-Aug-12)
  • Fixed in: B1.0
#49737
PDF page: 118
In the paragraph right after the code for add_product, the last sentence is worded strangely. It seems that something is missing after the word "star...more...
  • Reported in: B1.0 (24-Mar-13)
  • Fixed in: B2.0
#51121
PDF page: 120
The only edit needed for the line_items_controller.rb is the one noted by the --> arrow pointing to the second line starting "@line_item = ..." The ot...more...
  • Reported in: B1.0 (06-Apr-13)
  • Fixed in: B2.0
#51250
PDF page: 123
In reference to Donald Guy's submission #51022 I was able to reproduce this by restarting the rails server between changes instead of keep the rails s...more...
  • Reported in: B1.0 (13-Mar-13)
  • Fixed in: B2.0
#51022
PDF page: 123
Following along using the same versions (ruby 2.0, rails 4.0beta1), after rolling back the migration (rake db:rollback), I can't see the result as sho...more...
  • Reported in: P2.2 (17-Jun-12)
  • Fixed in: B2.0
#49445
PDF page: 125

The "David says" sidebar at the top of the page comes smack in the middle of the code example for line_items_controller.rb--Martin Wehlou

  • Reported in: P2.2 (26-Jul-12)
  • Fixed in: B1.0
#49593
PDF page: 125
I'm running rails 3.2.3. I received this error when trying to add a book to the cart: Can't mass-assign protected attributes: product adding ...more...
Sam Ruby says: Printing 3.0 is required in order to use Rails 3.2.3 or later.
  • Reported in: B1.0 (30-Apr-13)
  • Fixed in: B2.0
#51423
PDF page: 128

The word "has" should be "have" in "they has a lot of useful
information." This is in the admonition to review log files periodically.--Dave Hackett

  • Reported in: B1.0 (31-Mar-13)
  • Fixed in: B2.0
#51164
PDF page: 133
In the solutions wiki page for "Play Time" that the PDF links to, for Activity 2, the hint says "Hint: add two tests to test/unit/cart_test.rb", but t...more...
  • Reported in: P3.0 (19-Oct-12)
  • Fixed in: B1.0
#49965
PDF page: 134
I think you wanted to change the source for rails32/depot_k/app/views/carts/show.html.erb to be: <% if notice %> <p id="notice"><%= notice %></p...more...
  • Reported in: P2.2 (28-Apr-12)
  • Fixed in: B1.0
#49227
PDF page: 135
On page 135 of 737 in iBooks, there should not be a "\" in the following command: rails generate scaffold Product \ title:string description:text i...more...
Sam Ruby says: Please see footnote on this page
  • Reported in: P2.2 (08-Jul-12)
  • Fixed in: B1.0
#49508
PDF page: 136
Trivially, but annoyingly, Figure 20 splits the line_items controller code started on page 135. Also (trivially) the screenshot of the page has an unr...more...
  • Reported in: P2.1 (12-Jul-12)
  • Fixed in: B1.0
#49516
Paper page: 136
You forgot to run rake test:functionals after making these changes (iteration F1)! Most of the tests broke but I was on my own trying to figure out h...more...
Sam Ruby says: Covered in iteration F6
  • Reported in: P2.2 (06-Jun-12)
  • Fixed in: B1.0
#49409
PDF page: 138
the alias "j" is used to escape rendered partial for javascript. But "j" is an alias for "json_encode" while here escape_javascript is needed. So rai...more...
  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50975
PDF page: 139

Please update Footnote [24] to use rvm.io URL instead--Trung Lê

  • Reported in: B1.0 (07-Mar-13)
  • Fixed in: B2.0
#50976
PDF page: 139

Footnote [25] URL is no longer valid, the correct one is

gembundler.com/v1.3/bundle_exec.html--Trung Lê

  • Reported in: P2.2 (26-Jul-12)
  • Fixed in: B1.0
#49579
PDF page: 139
Paper page: 121
This did not work... redirect_to store_url, notice: 'Invalid cart' So I changed it to: redirect_to store_index_url, notice: 'Invalid cart' -...more...
Sam Ruby says: Make sure that config/routes contains as 'store' on the "root to" line. Verify using "rake routes"
  • Reported in: P3.0 (21-Nov-13)
#53190
Paper page: 141

I get an error stating that the 'jquery-ui' couldn't be found in the application.js file. Has the reference changed for jQuery UI? --Thomas

  • Reported in: P3.0 (13-Dec-12)
  • Fixed in: B1.0
#50369
PDF page: 142
This comparison <% if line_item == @current_item %> will always return false, it doesn't work, because we are comparing to different objects, and not ...more...
Sam Ruby says: can't reproduce
  • Reported in: P2.2 (05-Aug-12)
  • Fixed in: B1.0
#49631
PDF page: 150
Paper page: 132
I think something's missing here... <table> ➤ <%= render(cart.line_items) %> I did not get same display with the book (p.136) so I appended the i...more...
Sam Ruby says: I can't reproduce this problem.
  • Reported in: P3.0 (11-Dec-12)
  • Fixed in: B1.0
#50355
PDF page: 151
Paper page: 134
After "Let’s avoid all of that and replace the original template with code that causes the partial to be rendered:", the code snippet for "carts/show...more...
  • Reported in: P2.2 (06-Apr-13)
  • Fixed in: B2.0
#51251
PDF page: 152
Paper page: 134

The file rails32/depot_k/app/assets/stylesheets/carts.css.scss diff the content of the displayed in the book--Francisco Peña

Sam Ruby says: Updated in P3.0
  • Reported in: B1.0 (19-Mar-13)
  • Fixed in: B2.0
#51094
PDF page: 153
store.js.coffee ➤ $(document).on "page:change", -> ➤ $('.store .entry > img').click -> ➤ $(this).parent().find(':submit').click() The above code...more...
  • Reported in: P2.2 (29-Jul-12)
  • Fixed in: B1.0
#49595
PDF page: 157
The code segment shown for new.html.erb does not match my existing file at all. This confused me until I realized the code segment is just missing the...more...
  • Reported in: B1.0 (21-Apr-13)
  • Fixed in: B2.0
#51354
PDF page: 160
I could not get tests to pass, or the Checkout button to work without adding the following two lines to the orders_controller.rb: class OrdersContr...more...
  • Reported in: P3.0 (21-Oct-12)
  • Fixed in: B1.0
#49971
PDF page: 162
In the test fixture line_items.yml, you highlight one line for updating but the entire file listing you have does not match what was generated by the ...more...
Sam Ruby says: Somebody didn't do the second playtime exercise in section 10.3 :-)
  • Reported in: P2.2 (20-Jun-13)
#52037
PDF page: 164
Paper page: 146

Name "JQuery" should be "jQuery".--Ing. Martin Bachtík

  • Reported in: B1.0 (26-Mar-13)
  • Fixed in: B2.0
#51136
PDF page: 164
the code line <%= render(:partial => "cart_item" , :collection => cart.line_items) %> in the _cart.html.erb files should be the same as in Page 156...more...
Sam Ruby says: No 4th edition printing contains this text.
  • Reported in: P3.0 (21-Oct-12)
  • Fixed in: B1.0
#49972
PDF page: 165
In the code for orders_controller_test.rb, I only needed to modify the assert_redirected line. The post line was already correct. I am doing this un...more...
  • Reported in: P3.0 (21-Oct-12)
  • Fixed in: B1.0
#49973
PDF page: 166
The output from "select * from line_items;" should have 2 rows, the one you showed for the CoffeeScript line item but also one for the Ruby 1.9 line i...more...
Sam Ruby says: I'm not seeing that here: http://intertwingly.net/projects/AWDwR4/checkdepot-32/section-12.1.html
  • Reported in: B1.0 (06-Apr-13)
  • Fixed in: B2.0
#51247
PDF page: 168
The text describes selecting params[:order] in the first line, but the example has been updated to use strong params (calling the private order_params...more...
  • Reported in: P3.0 (26-Jan-13)
  • Fixed in: B1.0
#50603
PDF page: 169
There is a syntax error on the second line of the code for who_bought.atom.builder. There needs to be an equals between feed.title and its new value: ...more...
Sam Ruby says: It is correct as is. This is not an assignment, instead it is a method that creates a <title> element in the <feed>.
  • Reported in: B1.0 (20-Mar-13)
  • Fixed in: B2.0
#51099
PDF page: 172
In the last paragraph on the page you ask the reader to recall a section which they have not even read yet as it is much further on in the book! "R...more...
Sam Ruby says: Corrected reference to be to Section 8.5, Iteration C5: Caching of partial results
  • Reported in: B1.0 (04-Mar-13)
  • Fixed in: B2.0
#50954
PDF page: 175
Paper page: 160
I'd suggest you tell to add the before_action callback for the cart (before_action :set_cart, only: [:new, :create]). Otherwise, there will be a prob...more...
  • Reported in: P3.0 (21-Oct-12)
  • Fixed in: B1.0
#49974
PDF page: 175
In Figure 25, the URL in the location field is localhost:3000/en/orders which probably works if you are running the Rails app behind apache or nginx w...more...
  • Reported in: P3.0 (08-Nov-12)
  • Fixed in: B1.0
#50155
PDF page: 176

I created the file with ruby codes, and run it. but nothing happens to the database--derek

Sam Ruby says: I don't understand this errata.
  • Reported in: P3.0 (21-Oct-12)
  • Fixed in: B1.0
#49975
PDF page: 185
The integration test generated does not match your listing. It should be: require 'test_helper' class UserStoriesTest < ActionDispatch::Integ...more...
  • Reported in: P2.2 (06-Apr-12)
  • Fixed in: B1.0
#49074
Paper page: 190
[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 form errors...more...
  • Reported in: B1.0 (06-Apr-13)
  • Fixed in: B2.0
#51249
PDF page: 195
While editing users_controller.rb, you need to change user_params to permit :password and :password_confirmation (and probably disallow password_diges...more...
  • Reported in: B1.0 (06-Apr-13)
  • Fixed in: B2.0
#51248
PDF page: 196
The code example for the new user form omits the class="field" and class="actions" from the divs. Though they are included by the initial scaffold gen...more...
  • Reported in: P3.0 (14-Jan-13)
  • Fixed in: B1.0
#50466
PDF page: 200

specifically for the value of hashed_password.
...should be...
specifically for the value of password_digest.--T Farrington

  • Reported in: B1.0 (05-Mar-13)
  • Fixed in: B2.0
#50958
PDF page: 211
Paper page: 198
I'd suggest you to update the user_params private method in the user_controller in order to the controller test to pass (adding the :password and :pas...more...
  • Reported in: P2.1 (05-Dec-11)
  • Fixed in: B1.0
#48213
PDF page: 211
"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 at this...more...
  • Reported in: P3.0 (21-Nov-12)
  • Fixed in: B1.0
#50190
Paper page: 221
Should provide English version of errors.template, or there will be errors in English version. Also it's hard to know what errors.template.body says f...more...
Sam Ruby says: English versions are provided for everything that isn't built into Rails. The book prose describes what is being added to the file.
  • Reported in: P3.0 (22-Oct-12)
  • Fixed in: B1.0
#49976
PDF page: 222
In the code for app/views/orders/_form.html.erb, in Rails 3.2.8, it does appear that you need to use the i18n functions for labels if you want them tr...more...
  • Reported in: B1.0 (04-Apr-13)
  • Fixed in: B2.0
#51226
PDF page: 229

figure 37 shows
Body Html
not
Hay problemas con los siguientes campos:
--Tim Morgan

  • Reported in: P2.2 (22-May-13)
#51562
PDF page: 231

"Linux users should have already installed Apache in in Section 1.3, Installing on Linux, on page 6."
The word in is repeated--Daniel Garcia

  • Reported in: P3.0 (27-Dec-12)
  • Fixed in: B2.0
#50417
PDF page: 231
Reading and understanding chapter 16 was sometimes hard. I wasn't always sure whether you were talking about the server or the development machine. It...more...
  • Reported in: P3.0 (30-Jan-13)
  • Fixed in: B1.0
#50624
PDF page: 233
As of Mac OS X 10.8, the Web Sharing system preference is no longer included with the operating system. Apache can still be enabled via Terminal, or i...more...
  • Reported in: P3.0 (03-Feb-13)
  • Fixed in: B2.0
#50669
PDF page: 234
I had a lot of problems getting virtual hosts working in Apache. foundationphp.com/tutorials/apache22_vhosts.php is what finally helped me to get it w...more...
Sam Ruby says: That appears to be instructions on getting Apache running on Windows?
  • Reported in: P3.0 (23-Dec-12)
  • Fixed in: B1.0
#50407
PDF page: 241
# Deploy with Capistrano ➤ gem 'capistrano' should be # Deploy with Capistrano ➤ gem 'rvm-capistrano' Otherwise when invoking "cap deploy:set...more...
  • Reported in: P3.0 (24-Oct-12)
  • Fixed in: B1.0
#49988
PDF page: 242
In the paragraph after the capify command, you mention the creation of the Capfile and say that we do not need to modify it. You then show the conten...more...
  • Reported in: P3.0 (24-Oct-12)
  • Fixed in: B1.0
#49989
PDF page: 242
In the listing of the Capfile, you show the line: Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } ...more...
  • Reported in: P3.0 (03-Feb-13)
  • Fixed in: B2.0
#50668
PDF page: 243
If you are using Rails v3.2.11, there will be errors during deployment (when running cap deploy:migrations) with the deploy.rb file as-is. You need to...more...
Sam Ruby says: Can't reproduce (at least not on Rails 4.0.0.beta1)
  • Reported in: P3.0 (27-Dec-12)
  • Fixed in: B1.0
#50416
PDF page: 244
The last sentence in the first paragraph reads The :deploy_to may need to be tweaked to match where we told Apache it could find the config/public di...more...
  • Reported in: P3.0 (27-Dec-12)
  • Fixed in: B1.0
#50415
PDF page: 246
In the section "Using Console to Look at a Live Application" it reads # On your server $ cd /home/rubys/work/depot/ $ rails console production ...more...
  • Reported in: P3.0 (26-Feb-13)
  • Fixed in: B2.0
#50894
PDF page: 287
The block "order" starts with: "SQL that rows ...", which should be "SQL specifies that..." That is, the word "specifies" is missing.--Björn Peemöl...more...
  • Reported in: P2.1 (12-Feb-13)
  • Fixed in: B1.0
#50788
Paper page: 296
In the third paragraph (one above title 'Grouping Related Callbacks Together'), the sentence "If you try declaring them as handlers using the second t...more...
  • Reported in: B1.0 (28-Feb-13)
  • Fixed in: B2.0
#50919
PDF page: 305
I believe Rails Observers have been removed from Rails 4. It would be good if this section could be rewritten to expound on how to do things like an a...more...
Sam Ruby says: Removed subsection on Observers, added a link to Concerns: http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns
  • Reported in: P3.0 (29-Sep-12)
  • Fixed in: B1.0
#49895
PDF page: 351
It's missing the equal sign for the form_for on the first line of the get.html.erb view template. it should be: <%= form_for(:picture, url: {action...more...
  • Reported in: B1.0 (29-Mar-13)
  • Fixed in: B2.0
#51150
PDF page: 383

Replace current_cart with set_cart and SetCart module with CurrentCart--Trung Lê

  • Reported in: B1.0 (29-Mar-13)
  • Fixed in: B2.0
#51151
PDF page: 383

Please explain the usage of concerns here, as a beginner, they would get very confused--Trung Lê

Sam Ruby says: As explained in the text, a concern is nothing more than a way to share common code (even as little as a single method) between controllers. If you feel this is not enough, consider starting a discussion on the forum, and we can work through this. http://forums.pragprog.com/forums/148
  • Reported in: B1.0 (29-Mar-13)
  • Fixed in: B2.0
#51153
PDF page: 384

It is highly recommended to use #find_by method in Rails 4. Please replace find_by_product_id with find_by(product_id: id)--Trung Lê

  • Reported in: B1.0 (29-Mar-13)
  • Fixed in: B2.0
#51154
PDF page: 399

" ...“ordered pairs of product_ids and quantity.”

Change product_ids to product_id--Trung Lê

  • Reported in: P3.0 (10-Feb-13)
  • Fixed in: B1.0
#50781
PDF page: 430
"You can see the list of middlewares that Rails provides for Rails applications using the command rake middleware." That should probably read, "...mid...more...
Sam Ruby says: It is Rails, not Rake, that provides middlewares to a Rails application. For convenience, a rake task is provided which shows you these middlewares.
  • Reported in: P3.0 (26-Feb-13)
  • Fixed in: B2.0
#50898
PDF page: 431
When I run the command rails generate jquery:install --ui --force I get deprecated You are using Rails 3.1 with the asset pipeline enabled, so ...more...
Sam Ruby says: Those instructions were removed in the second printing.
  • Reported in: P3.0 (18-Aug-12)
  • Fixed in: B1.0
#49714
PDF page: 432
Original code doesn't escape directory white spaces. See suggested change below. namespace :db do desc "Backup the development database" ...more...
Sam Ruby says: Good catch. Went with Shellwords.escape instead.
  • Reported in: B1.0 (04-Apr-13)
  • Fixed in: B2.0
#51227
PDF page: 581

who_boughtrequests should have space in between--Trung Lê

Sam Ruby says: the only occurrence I can find of this sequence of words is on page 176, and on this page there is a line break between the two words.

Stuff To Be Considered in the Next Edition

  • Reported in: P2.2 (11-Apr-12)
#49099
PDF page: 1

Could the report-erratum url in the pdf footer, be modified to contain the pdf page number?--Brian Maltzan