Errata for Agile Web Development with Rails, Third 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 P5.0,
released 7 days 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.
| PDF |
Paper |
Description |
Found in |
Fixed in |
|
128 |
#42272: the html code in _cart_item.html.erb doesn't work as written, there seems to be an open <tr> with no ending </tr>, and I cannot work out where to place the </tr>. --kacey #42272: the html code in _cart_item.html.erb doesn't work as written, there seems to be an open <tr> with no ending </tr>, and I cannot work out where ...more...
|
P4.0
07-Feb-10
|
|
|
128 |
#42282: Please remove previous erratum <tr>, typo with javascript defaults was causing the error.--kacey
|
P4.0
08-Feb-10
|
|
| 143 |
|
#42139: I realize that the Store application is designed to give someone unfamiliar with Rails a really quick tour of what an awesome app you can make in a short time. Nevertheless, I feel like the discussion on the foreign key sqlite3 "hack" is a bit....hand-wavey? I don't know a lot about sqlite3 or SQL in general, but it feels like the book skips over this pretty quickly.
When learning from a book i think "Hm, would i have thought to do that? Maybe with some Google-fu?" as a measure of "Did you _really_ get it." I don't think I would have come to putting these DDL calls in unless I had seen it in the book.
Maybe explain what's going on here? Or put it in a footnote? Or a Joe Asks? Or cover the theory in one of the later chapters about DB design?--Steven Harms #42139: I realize that the Store application is designed to give someone unfamiliar with Rails a really quick tour of what an awesome app you can make ...more...
|
P4.0
22-Jan-10
|
|
| 412 |
|
#42273: In the discussion of how to build a callback class and express it throughout all models, I think that a critical question is not addressed:
(1) how do we get this file "sourced" into the Rails runtime. If you put it in lib as a module does it automatically get loaded up? How can we get it to run as the environment boots up. The example source file is given as a stand-alone script.
(2) It appears that we're being encouraged to monkey-patch ActiveRecord::Base. While the ability to do this is one of the amazing joys of Ruby, it might be good to explain why this may or may not be a good idea. Many a tweet has gone out on the difficulty monkeypatching has introduced in code-sharing / debugging.--Steven Harms #42273: In the discussion of how to build a callback class and express it throughout all models, I think that a critical question is not addressed:
...more...
|
P5.0
08-Feb-10
|
|
Stuff To Be Considered in the Next Edition
| PDF |
Paper |
Description |
Found in |
Fixed in |
|
18 |
#41589: ERb is defined as "Embedded Ruby" on p. 18 but is not in the index, please add to index. P2.0 printing April 2009 Version: 2009-4-7, please add this printing to the selection dropdown for Errata as well, this is the paper version I have. Thanks.--M. Roxas #41589: ERb is defined as "Embedded Ruby" on p. 18 but is not in the index, please add to index. P2.0 printing April 2009 Version: 2009-4-7, please a ...more...
|
P1.0
21-Nov-09
|
|
|
114 |
#42012: To produce the sans-serif cart title shown in the "screen-shot", the css for .cart-title needs to be "font: bold 120% sans-serif;". ("120% bold" fails in both Safari 4.0.4 and Firefox 3.5.5)
I believe erratum notification #41977 is incorrect and should be removed - the item price is defined in cart_item.rb to be the product price times the quantity in the cart.--Allan Kinnaird #42012: To produce the sans-serif cart title shown in the "screen-shot", the css for .cart-title needs to be "font: bold 120% sans-serif;". ("120% bo ...more...
|
P4.0
05-Jan-10
|
|
| 137 |
|
#42022: For those who did the additional problem of linking using the book image. Here is the AJAX code to perform the same task as the new AJAX button:
<%= link_to_remote (image_tag(product.image_url), :url => { :action => 'add_to_cart',:method => :post, :id => product }) %>
Which is inserted between <div class="entry" and <h3><%= product.title %>--Andrew Szczepanski #42022: For those who did the additional problem of linking using the book image. Here is the AJAX code to perform the same task as the new AJAX butto ...more...
|
P1.0
08-Jan-10
|
|
| 171 |
|
#41917: As of the end of section 11.2 the admin_controller function is not working as intended in the case of erroneous logins.
Having a seperate terminal window to view messages I see the flow of login and password unhashed (is this a possible security hole?). Upon proper credentials, the user is sent to the /admin address. As intended. However upon improper credentials, the page is reloaded (intended) but the
flash.now[:notice] = "Invalid user/password combination"
is not kicking in.
I assumed that because of the lack of a views/layouts/admin.html.erb
file, this was occuring.
Upon creation of that file (a simple duplicate of users.html.erb - which in itself is raising a non-DRY issue)
the message appears.
I'm definitely a newbie. This is an interesting bug to leave lying around as an exercise (confirms learning).
But I'm also curious about the security hole and non-DRY issue at hand and resolving it.--Jerome Marchand #41917: As of the end of section 11.2 the admin_controller function is not working as intended in the case of erroneous logins.
Having a seperate t ...more...
|
P4.0
26-Dec-09
|
|
| 203 |
|
#41429: The i18n.t examples are leaving the colon out of the message, for example:
<%= form.label :name, I18n.t('checkout.name') + ":" %>
This should be consider bad i18n, since some languages may and do want to use different character for the colon, or leave it out altogether. It is also a sign for translators that it is used as a label.
--Niklas Laxström #41429: The i18n.t examples are leaving the colon out of the message, for example:
<%= form.label :name, I18n.t('checkout.name') + ":" %>
This sho ...more...
|
P1.0
14-Nov-09
|
|
| 204 |
|
#41924: On the use of UTF-8, HTML and Javascript...
Page 194, section 13.1 states:
"if you do this, just make sure that your editor is configured for UTF-8."
But then when dealing with the localisations for the checkout, the following is presented:
address: "Dirección"
pay_prompt: "Seleccione un m\xC3\xA9todo de pago"
which is a by-product of passing the values via javascript I suspect.
Presently, I literally have a situation where the i18n.rb file has the tilde-n inserted as such and renders (I saved it in UTF-8, no BOM encoding) . The es.yml file has a mix of HTML and hex characters (it does not take kindly to UTF-8 encoding). Three flavours for one objective; dispersive, if not un-DRYish.
This is a point for a someoneSays box to highlight some pitfalls. And maybe suggestions.
Above all, a language file in hexa is rather difficult to read, increases data entry problems, lengthens checking (what will the professional translator do? Upon creation is one thing, upon editing is another! [scent of bad coupling]) and gets moreso as its size increases. Needs to be avoided...--Jerome Marchand #41924: On the use of UTF-8, HTML and Javascript...
Page 194, section 13.1 states:
"if you do this, just make sure that your editor is configured f ...more...
Sam Ruby says: There's a bug report on Rails open on this: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2409-activerecord-double-escapes-error_messages_for
I plan to address this in the next edition.
|
P4.0
26-Dec-09
|
|
| 657 |
|
#41595: The instructions for creating the empty git repository assume git has been installed on the git server. But the reader was not told to install git. "$ git --bare init" will fail if git is not installed. This was found in p3.0, 2009-9-21 PDF.--Jamie Allen #41595: The instructions for creating the empty git repository assume git has been installed on the git server. But the reader was not told to instal ...more...
|
P1.0
22-Nov-09
|
|