Historical errata for Agile Web Development with Rails
PDF Pg
Paper Pg
Type
Description
Fixed on
Comments
67
ERROR
Under “Create the Maintenance Application”, it says we’ve created our development, test, and production databases, but at this point we’ve only created the development database (on Page 59).
2006-05-02
75
TYPO
Caption for Figure 6.4: “rpice” should be “price”
2006-05-02
79
TYPO
“tablein” should be “table in” in sentence “It would be nice if we could load the data into our tablein a more controlled way.”
2006-05-02
81
TYPO
Bullet item “We used Ruby’s sprintf() method …” - in the preceeding rhtml fragment sprintf() is never called.
2006-05-02
81
TYPO
Bullet item “We used Ruby’s sprintf() method …” - “divied” should be “divided”
2006-05-02
86
TYPO
“is” should be “in” in “… we jointly decided to see what happened if we displayed the products is alphabetical order …”
2006-05-02
86
TYPO
Last paragraph on page, missing “we” in “This time, we used the h(string) method …”
2006-05-02
88
TYPO
“ona” should be “on a” in “Pragmatic Web Designer is off getting inspiration ona beach somewhere …”
2006-05-02
89
TYPO
Last paragraph, “that” should be “than” in “It’s starting to get a bit long, so rather that include it inline …”
2006-05-02
90
TYPO
Second to last paragraph, “renefered” should be “referred” (or possible “referred to”) in “The methods we define in a controller-specific helper are available to views reneferred by that controller.”
2006-05-02
91
SUGGEST
The format string for sprintf() could be “$%d.%02d” instead of “$%d.%02.2d” since cents will always be in 0..99 (marginally easier to parse by the reader).
2006-05-02
92
TYPO
Second paragraph, “one” should be “want” in “And a POST request is just the ticket when we one to do something like add an item to a cart.”
2006-05-02
66
TYPO
Top of page
——————
wil create and drop…
should be,
will create and drop
2006-05-07
2
TYPO
The word “change” is misspelled as “cdhange” in the sentence that reads, “For programmers used to other web frameworks, where a simple cdhange to the schema could involve them in half-a-dozen or more code changes, this was a revelation.”
2006-05-07
79
OK
Add a space between the words ‘table’ and ‘in’ (third paragraph, next to last sentence)
“It would be nice if we could load the data into our tablein a more controlled way.”
Should be,
“It would be nice if we could load the data into our table in a more controlled way.”
(Dave says: I see a space there)
2006-05-22
96
TYPO
“it you now look at your database” should be…
“if you now look at your database”
2006-05-07
6
TYPO
Under the “Change Log” the first sentence reads: There are probably a thousand changes that have been applied to Rails since the first version of this book wen to press.
I think it should read: “…since the first version of this book went to press.”
2006-05-07
96
ERROR
Running “rake db:sessions:create” does not create a new table called “sessions”, it creates a new migration for adding the “sessions” table.
You must run “rake db:migrate”, as well.
2006-05-07
97
TYPO
Omit the word ‘and’. (Paragraph before ‘Creating a Cart’ section.
—-
"Be careful as you add additional methods to this controller as we work further on the cart
2006-05-07
97
TYPO
Last line on page.
—
“The cart is basically a wrapper for an array of atems.”
should be,
“The cart is basically a wrapper for an array of items.”
2006-05-07
26
ERROR
Hi David, nice 2nd edition! I’m Marc, one of the developers from the RadRails team. Thanks for the plug in the book, that’s awesome! One correct though, we didn’t win a Jolt award, it was the Best Open Source Developer Tool based on Eclipse award. Thanks again!
2006-05-07
99
OK
Change ‘tart’ to ‘start’
"Let
2006-05-07
99
TYPO
Change “you’ve” to “you’re” (Last paragraph)
"Your browser will probably warn you that you
2006-05-07
102
TYPO
Change “out” to “our”
"Rather than out new cart, we
2006-05-07
103
TYPO
Change “out” to “our”
"…we
2006-05-07
28
SUGGEST
It may be somewhat damning to suggest that there are “There are no fully-fledged IDEs for Ruby or Rails.” especially given the existence of RadRails.
That said, Textmate owns and I’m glad to see proper respect paid here :-)
Just wouldn’t want the book to appear too dated even before it goes to print.
2006-05-07
33
TYPO
“WEBRick or Lightthpd?” Lighttpd is misspelt with an extra h in the header of the callout
2006-05-07
65
SUGGEST
I would be nice to see an example of prefilling tables from
migration code. For example if you want to want a table to allready contain an admin or something like this.
cheers
(Dave says: this wil be in the migrations chapter)
2006-05-07
124
TYPO
5th paragraph - `Just look at the
cart in the sdiebar.’
2006-05-07
23
TYPO
“managerl” should be “manager”
“It has one slight disadvantage: you delegate control of your installation layout to the package managerl.”
2006-05-07
25
OK
Could we get a pointer to using Subversion with Rails here? Maybe a condensed version of http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion or http://maniacalrage.net/past/2006/4/12/heres_how_i_create_a/ or http://blog.teksol.info/articles/2006/03/09/subversion-primer-for-rails-projects
(Dave says: I think that’s probably out of scope, and I’m leary about pointing to blog entries from the book)
2006-05-07
1
TYPO
In the first paragraph, second sentence, the word “a” is missing between “being” and “worldwide”. It should be, “… Rails went from being an unknown toy to being a worldwide phenomenon.”
2006-05-07
23
TYPO
In the fifth paragraph, second sentence, you refer to “OX X” instead of “OS X”.
2006-05-07
25
TYPO
In the footnote at the bottom of the page, (where else do footnotes live?), in the second sentence, the word “to” is missing between “you” and “type”. It should read, “It allows you to type the …”
2006-05-07
26
TYPO
In the footnote at the bottom of the page, second sentence, you have the word “you’re” instead of the word “you’ve”. It should read, “That’s before you’ve written a thing….”
2006-05-07
118
TYPO
Change ‘out’ to ‘our’. (First paragraph on page)
—-
"To do that, let
2006-05-07
120
ERROR
At this point, the suggested change to the store_controller.rb should be
redirect_to :action => :index
instead of,
redirect_to_index
The redirect_to_index method requires a “msg” for the flash
(Dave says: I shows the updated version of redirect_to_index instead)
2006-05-07
121
ERROR
“So, open up store.rhtml in the app/views/layouts directory, and replace the button_to( ) call with something like this:”
Should be,
“So, open up index.rhtml in the app/views/store directory, and replace the button_to( ) call with something like this:”
2006-05-07
41
OK
In the “Ho! Ho! Ho!” example, an extra line break is inserted before “Merry Christmas!”, but the code would not cause that line break.
(Dave says: The output shows the generated HTML, not the appearance on the screen. It will have a blank line)
2006-05-07
27
TYPO
The first word on the page should be “Arachno” instead of “Aracho”.
2006-05-07
116
SUGGEST
You mention that components have fallen out of favor in the Rails community. However, nowhere does it seem to be explained why components are seeing less use, nor are we ever told what is being used to supplant them. For those of us who’re already using components in our applications, it would be nice to see what problems the Rails community has had with them, as well as have suggestions of what to migrate them to—especially if there’s any intention to remove components from Rails in subsequent releases.
2006-05-22
27
TYPO
The third paragraph in the section named “The Desktop”, third sentence, the word “tree” at the end of the sentence should be plural.
2006-05-07
101
TYPO
Although the error and subsequnt technique for fixing it is discussed on page 103, the code listing for app/models/cart.rb on page 101 already includes the line:
include Reloadable
I would assume you meant to leave it out until later…
2006-05-07
28
TYPO
In the first paragraph, the last sentence doesn’t make sense. It should be rewritten to be something like, “The Rails database adapters hide these differences so that a Rails application doesn’t need to know what kind of database it is running on.”
2006-05-07
61
TYPO
Inside the “Selecting a Different Database” box, last sentence: “… apppropriate …”
2006-05-07
66
TYPO
Second paragraph: “Edit the file so that in looks like the following.” s/in/it/
2006-05-07
66
TYPO
Footnote: “Your scheme will be transported back in time…” s/scheme/schema/
2006-05-07
74
TYPO
Footnote: “so Rails store …” s/store/stores/
2006-05-07
70
TYPO
Change “scoffolding” to “scaffolding”.
2006-05-07
138
SUGGEST
Syntax highlighting for many .rhtml code examples in the book are inconsistent and not colored properly. For instance, almost every occurance of a closing html tag has the greater-than symbol the wrong color. Minor detail, but noticable…
2006-05-07
137
TYPO
Third paragraph after the app/controllers/store_controller.rb code example, it says:
“Or maybe the user has tried to enter an order, but thier data hase failed validation.”
Where it should be the word “has”:
“Or maybe the user has tried to enter an order, but their data has failed validation.”
2006-05-07
137
TYPO
Last paragraph states:
“These helpers interactive with the controllers…”
Where it should be “interact”…
2006-05-07
73
TYPO
“shouw” should be “show”
2006-05-07
128
TYPO
Next to last paragraph: "… let
2006-05-07
131
TYPO
Next to last paragraph: “… as we saw, startign with a conventional application mkes it easier …” s/startign/starting/, s/mkes/makes/
2006-05-07
141
TYPO
Footnote 5: “… being fed values fromthe forms it creates.” s/fromthe/from the/. Also, “If there were to set an unknown payment type, …” s/there/they/?
2006-05-07
143
ERROR
Although mentioned several times, it appears the requisite code to implement validation on the Order model has been skipped. Consequently the suggestion to place an order without filling in any of the form fields succeeds in placing an order without any details.
2006-05-07
168
TYPO
example rxml code shows “xml.name” but Figure 12.2 on the next page shows it as being “title”
2006-05-22
22
TYPO
Footnote 3 refers to “global Window’s environment” which should probably be “global Windows environment” instead.
2006-05-07
88
SUGGEST
shouldnt YIELD be used instead of content for layout?
(I’m fighting hard not to have @content_for_layout deprecated. In fact, I just talked with DHH, and content_for_layout isn’t going away)
2006-05-09
27
TYPO
In ‘The Desktop’ the 2nd sentence of the 2nd paragraph ends in ’ and a browser window permentently open’ where it should be ’ and a browser window permanently open’.
2006-05-07
25
TYPO
In Editors paragraph:
"I
2006-05-07
89
ERROR
The logo.png provided at http://media.pragprog.com/titles/rails2/code/depot_e/public/images/logo.png has a different background color than the depot.css sets the top bar to.
2006-05-07
148
SUGGEST
A reminder to run ‘rake db:migrate’ might be worthwhile.
2006-05-07
159
ERROR
The ‘authorize’ method should probably not be public; as written it creates a new action in every controller.
2006-05-07
161
ERROR
In delete_user, render(:action => :list) should probably reference :list_users instead. Better yet, it should redirect.
2006-05-07
xii
TYPO
“far deeper that I’d expected” -> “far deeper than I’d expected”
2006-05-07
96
TYPO
The reader is told to run the command:
depot> rake db:session:create
It should be
depot> rake db:sessions:create
2006-05-07
48
SUGGEST
In the discussion of the :action parameter of the link_to method, the code in the rhtml file has double quotes around the action “goodbye” but the description has the action in single quotes. For someone totally unfamiliar, you should either use single quotes in both locations or double quotes in both locations in order not to confuse them.
2006-05-16
181
TYPO
After the code listing: "Here we
2006-05-08
182
TYPO
End of third paragraph: “… convenient way to refenece test data …” s/refenece/reference/
2006-05-08
182
ERROR
Since the depot schema is now storing product prices as an integer, the fixtures should also reflect this.
2006-05-08
101
OK
When editing add_to_cart.rhtml, item.title is not correctly changed to item.product.title, causing an error upon page reload.
(Dave says: CartItem has a title method)
2006-05-07
187
TYPO
assert_nil/assert_not_equal should be assert_nil/assert_not_nil
2006-05-08
59
ERROR
In the sentence immediately before the “Configure the Application” title, you have a reference to another section that was not correctly expanded. sec.test.db.config on page ?? should reference the real location.
2006-05-07
195
TYPO
Under assert_tag :content, "
2006-05-08
127
TYPO
Change ‘iterm’ to ‘item’ (First paragraph)
—-
“Click to add an iterm to the cart,”
Should be,
“Click to add an item to the cart,”
2006-05-07
127
TYPO
Replace ‘and’ with ‘a’ (Forth paragraph)
"…the whole sidebar redraws on the transition between and cart that
2006-05-07
125
TYPO
“ClassItem” should be “CartItem”
2006-05-07
59
SUGGEST
I really think you should encourage people to not connect to mysql as the root user with no password. It is relatively easy to create a user to use with the depot databases that has all the permisions it needs. For instance, after the line that creates the development database you could have the following lines:
depot> mysql -u root -p mysql
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON depot_development.*
-> TO ‘depot_user’@‘localhost’
-> IDENTIFIED BY ‘agile_shopper’;
mysql> quit
This creates the user that only has access to this database when connecting from the localhost. Tell the users to update database.yml with the user and password. Also warn them that the database.yml file that is generated does not have a space after the : for the password field for the development and test databases. This space is required. The password field for the production database does have a space already.
By recommending this, people will not get into the habit of using the root user without a password. We do not want a repeat of the type of break-in that occured to the apache.org web site which was accomplished by attacking the site through its connection to mysql using the root user and no password.
(Dave says: it’s a tradeoff: do that, and folks tie themselves into knots as we proceed. Instead, I’ve added an addiitional warning)
2006-05-07
71
TYPO
It the paragraph describing 002_add_price.rb, the word “featutes” should be “features”.
2006-05-07
111
TYPO
The sentence: She notices a minor things … is obviously not right.
2006-05-07
113
TYPO
The sentence: Rather that use …
should be: Rather than use …
2006-05-07
113
TYPO
The sentence: Again, we’ll rely of CSS to do …
should read: Again, we’ll rely on CSS to do …
2006-05-07
127
TYPO
Refers to the _add_to_cart template. Since this is an .rjs and no longer a partial, the leading underscore should be removed.
2006-05-07
131
TYPO
Replace “browsers” with “browser’s”.
2006-05-07
131
TYPO
Fill in “Chapter xx of Pragmatic Ajax [?]” with the eventual values.
2006-05-07
508
SUGGEST
would be nice to see some real world examples like in the first book. i think you’ve got a lot to tell with all the 37 signals apps. ;-)
(Dave says: I’m not privy to 37s architectures… Ezra is writing a whole book on deployment, though)
2006-10-04
1
TYPO
2nd last paragraph, “disovered” -> “discovered”.
2006-05-07
132
TYPO
The database migration file for create_orders is numbered 004. However, if following the tutorial, it will be 005.
The create_line_items migration suffers from this same problem—it should be 006.
2006-05-22
7
TYPO
Third bullet:
We use JavaScript effects, Ajax,and RJS
should be “Ajax, and”
2006-05-07
104
TYPO
"which wasn
2006-05-07
24
TYPO
The locomotive URL runs off the side of the page (first line)
2006-05-07
139
TYPO
In the code listing for checkout.rhtml, the first div is given an id=“depot-form”. However, in the CSS for this page, depot-form is referred to as a class rather than an id (as a “.” vs. “#”). This should be changed to either a class, or the depot.css file should be changed to refer to depot-form as an id.
2006-05-07
204
ERROR
The code listing is missing a final ‘end’ to close the definition of regular_user.
2006-05-08
205
TYPO
Next to last paragraph: “… (you can get to it in the instance variable integration_session is you really need to).” s/is/if/.
2006-05-08
206
TYPO
Code listing, top of page: “open_sesion do |sess|” s/sesion/session/.
2006-05-08
206
ERROR
The example code for ‘host’ is confusing and/or erroneous.
sess.host = fred.blog_per_user.com
I imagine there should be quote marks around the assigned value. But also, underscores are not technically valid in domain labels corresponding to host names. And finally, (as a general suggestion throughout the book) it is preferable to use the reserved top-level or second-level domains for all documentation examples (e.g. example.com) rather than a live (or potentially live) domain. See RFC 2606.
2006-05-08
208
TYPO
Next to last paragraph: "Let
2006-05-08
19
SUGGEST
It would make more sense if “starting out with the difficult stuff” read “starting out with the easy stuff”.
2006-05-07
19
OK
“Because Rails it just so easy” -> “Because Rails is so easy”
(Dave says: I’m happy with the idiom)
2006-05-07
90
TYPO
In the last paragraph, second sentence, it starts with 2 “the”s.
2006-05-07
125
TYPO
The first ‘is’ in ‘Whenever an item is the cart is updated’ is a typo.
2006-05-07
466
TYPO
Under the description for @sent_on: “ATime object …” s/ATime/A Time/.
2006-10-04
5
TYPO
Line 1 : “a indication”> “an indication”
2006-05-07
316
SUGGEST
On page 316, there is a “Joe asks” section saying how after_find and after_initialize would slow things down, so the Rails team agreed on increased performance.
However, this section does not make sense at this stage because we were not introduced to any differences in the after_find and after_initialize methods until a page later. In other words, I was momentarily left wondering, “…alright, they agreed on increased performance how?”.
It may be more beneficial to include this “Joe Asks” section after the text “Because of a performance optimization, the only way to define callbacks for the after_find and after_initialize events is to define them as methods.”
2006-07-21
60
TYPO
There’s something wrong with the PDF. On this page most of the page makes the cursor really large and doesn’t allow me to select single lines of text with Adobe Reader 6.0.
(Dave says: I don;’t see this here wth either Acrobar or Preview. Anyone else see this?
2006-05-28
60
ERROR
The last sentence that goes to the next page about there being more information in database.yml about PostgreSQL and SQLite isn’t true. My database.yml only contains information for mysql by default.
2006-05-07
62
TYPO
"or if you
2006-05-07
64
TYPO
"And once you
2006-05-07
64
TYPO
"what
2006-05-07
79
TYPO
Spacing in footnote is messed up.
2006-05-07
115
TYPO
Both chapters 9 and 10 are labeled as task D
2006-05-07
117
TYPO
Second line, first paragraph, find is mispelled. “Whenever you fnd …” should read “Whenever you find …”
2006-05-07
53
OK
In the example loop 3.times do … the correct output should be:
Ho! without the html tag
2006-05-07
74
OK
:only_integer should be false to allow float values
()Dave says: the price is an integer)
2006-05-07
374
TYPO
There is a ‘return’ immediately into the ‘def verify_premium_user’ method, which seems like a typo.
2006-07-25
21
TYPO
Line 2: “comamnds”> “commands”
2006-05-07
25
ERROR
I don’t quite know how to categorize this one. The footnote says for Windows “editing your system properties and setting to 9.” Which doesn’t mean anything. I guess you mean to say “changing your \\HKLM\\Software\\Microsoft\\Command Processor\\CompletionChar registry value to 9”, and maybe mentioning XP enables it by default.
(Dave says: yes - there was a missing chunk in there)
2006-05-07
27
SUGGEST
At the end of the Editors section, you say “learn a new feature each day.” I feel it should read “every day,” while the distinction in usage is fairly subtle and somewhat subjective.
2006-05-07
109
SUGGEST
While the footnote is already lengthy, you may want to suggest using OS X’s Console application where appropriate as a free alternative with a convenient clearing/updating
2006-05-07
113
SUGGEST
This is somewhat snarky and more annoying than poignant:
Rather that use
elements for each item, let
2006-05-07
28
TYPO
(debatable) “100Mb of IDE” -> Be it HDD or RAM, you’ll talk in megabytes, not megabits, I guess. The proper abbreviation then is “MB”.
2006-05-07
102
TYPO
In the second to last paragraph, last sentence, you have “if” instead of “in”. It should read, “And, in fact, …”
2006-05-07
147
SUGGEST
Not all environments specify the correct ruby binary. The command should start with ruby: depot> ruby script/generate model user
2006-05-07
115
TYPO
In the third paragraph, fourth sentence, missing the word “the”. It should read, “… can interact behind the scenes with the application …”.
2006-05-07
117
TYPO
In the last paragraph, third sentence, you are missing the word “use”. It should read, “… the main template arranges to use a variable …”.
2006-05-07
123
TYPO
In the paragraph right after the code for add_to_cart.rjs, last sentence needs to be re-worded to something like, "… to use that HTML to replace the content of the
with the id= of cart.
2006-05-07
123
TYPO
After making all the updates and reloading the store/index page and verifying that the correct HTML was generated and the javascript files loaded, the AJAX cart still didn’t work and the developer.log file had the following error:
ArgumentError (undefined class/module Cart):
Stopping WEBrick and restarting it caused this error to go away. You might want to mention this in the troubleshooting discussion as a way to make sure all the current code is loaded.
2006-05-07
124
TYPO
In the first paragraph of the section titled “The Customer’s Never Satisfied”, the fourth sentence, the work “now” is used instead of “know”. It should read, “… eager for the praise we know will come.”
2006-05-07
127
TYPO
In the second paragraph after the code fragment, second sentence, you have “reveals” instead of “reveal”. It should be, “… which will smoothly reveal the cart, …”.
2006-05-07
123
TYPO
Bottom of the page in the Troubleshooting section. First sentence “it can’t make (if) foolproof” (if) should read (it).
2006-05-07
131
TYPO
In the fourth bullet point, the word “change” needs to be plural. It should read, “To help the user see changes to the cart, …”
2006-05-07
136
TYPO
the line item cannot exist unless the correspond order and product rows exist.
should be
the line item cannot exist unless the corresponding order and product rows exist.
2006-05-07
134
TYPO
In the last paragraph, first sentence, it states that we are currently at version 3 of the database when we are actually at version 4. As mentioned in previous errata, the new migrations are numbered 005 and 006.
2006-05-22
138
TYPO
dealing with an object names “order”
should be
dealing with an object named “order”
2006-05-07
137
TYPO
In the third paragraph, third sentence, you have the word “the” instead of “then”. It should read, “… into the form fields, and then extracting …”
2006-05-07
138
TYPO
In the fourth paragraph, last sentence, the word “automatically” is mispelled. The sentence should read, “… it is automatically associated …”
2006-05-07
138
TYPO
In the fifth paragraph, second sentence, you have the word “need” instead of “needs”. It should read, “It’s important to remember that Rails needs to know …”
2006-05-07
4
ERROR
“…support for…mock objects” - unless it’s newly arrived in Rails 1.1, Rails supports stubs rather than genuine mock objects. You will remember this comment (from a number of people) from the first edition.
2006-05-07
1
OK
Most developers will probably recognize l33t speak, but some managers and other readers may not. You may want to add parenthetical definition.
2006-05-07
1
OK
The first page and a half do not read very well (not meaning to sound offensive). They seem like fragments gathered from various casual emails. The Intro read much more smoothly in the first edition.
Many paragraphs are tied together so there is no clear logical break between them.
“Rails went from being an unknown toy to being worldwide
phenomenon.” would sound more “professional” as “Rails went from being a private experiment to being worldwide
phenomenon.” The use of “toy” is not confidence inspiring.
The use of “strong” language can be used to good effect occasionally, but you do risk offending some.
As someone looking at various frameworks for a upcoming project, it would be nice to see more specific information comparing features of other frameworks (without bashing). Catalyst, Jifty, Maypole, PHP, Struts, etc. It would be considered flame-bait on mailing-lists, but I’ve seen it done well in books. It doesn’t have to bash, just compare features.
The example code may not be a helpful illustration to beginners. A short paragraph explaining that the code describes the relationships of various data and sets up some constraints would help.
I’m not sure the ChangeLog for the depot application is helpful to most readers-it is probably more confusing to first time readers than helpful.
2006-05-07
140
ERROR
The depot.css for .depot-form legend should specify font-family instead of font-style. The definition should be:
Near top of page, “And, once youve chosen an editor” - missing apostrophe in “you’ve”.
2006-05-07
33
SUGGEST
On this page you have body text saying what script/server does, a footnote explaining what WEBrick is, and a box at the top of the page saying that you might not get WEBrick after all. It’s a bit jumpy. Could you put the description of WEBrick in line, and the ‘exception’ regarding lighttpd in a footnote?
2006-05-07
30
SUGGEST
Keeping up to date also involves updating Rails files in your application.
2006-05-07
35
OK
Gratification could be substantially more instant if you generated the Say controller with the hello action (script/generate controller Say hello). Browsing http://localhost:3000/say/hello then shows a view that tells you where it lives (“Find me in app/views/say/hello.rhtml”).
You would still show hand-addition of action and view when going on to “goodbye”. (For “goodbye” you could also demonstrate that the action method isn’t required - that Rails will go straight to the view with the same name if there’s no action method.)
(Dave says: I thought hard about tis originally, but decided this flowed better, as it let me talk about URLs a bit)
2006-05-07
43
OK
Seeing dynamic content is great, but the reader may be immediately concerned about the displayed date/time format. This is a perfect opportunity to introduce a helper method.
2006-05-07
44
SUGGEST
“Why did we go to the extra trouble of setting the time to be displayed in the controller and then using it in the view?” - Fundamentally it’s because the Time instance is a model (although it’s not persistent, and we didn’t have to write the class for it), and it’s the controller’s job to provide the model for the view to display.
2006-05-07
63
ERROR
(Bottom of page) "If your file uses tabs, not spaces, to indent the lines following depot_devlopment: you
2006-05-07
104
TYPO
“automatically” is spelled wrong.
"First, the cart and cart item classes weren
2006-05-07
122
TYPO
“Parameters” is misspelled.
“This takes a hash of values that are the same as the trailing par meters we passed to button_to( ).” should be “This takes a hash of values that are the same as the trailing parameters we passed to button_to( ).”
2006-05-07
123
TYPO
is can be hard to check
should read
it can be hard to check
2006-05-07
149
SUGGEST
You mention that you want to create a private class method self.encrypted_password. Since the readers are probably new Ruby users, you should probably include the private statement in the source snippet. Also, you should mention that create_new_salt is a private method that should occur after the private statement.
2006-05-07
150
SUGGEST
When reviewing the code for user.rb, there are two items in the source that were not mentioned in the discussion. The first is the need to require digest/sha1 for the encription done in encrypt_password. It should probably be mentioned in the discussion for this method. The second is the definition of safe_delete. Once again, if it is going to be in the source, it should probably be discussed somewhere.
2006-05-07
113
OK
While I realize inject is likely to be covered in an appendix on basic ruby techniques, as with the first edition, a breakdown of why this was chosen here and its particular mechanics would be a welcome addition.
(Dave says: tough call. I think I’d rather not break the flow here)
2006-05-07
121
TYPO
2nd line from the bottom should be read “open up index.rhtml” instead of “open up store.rhtml”.
2006-05-07
160
TYPO
In app/views/layouts/admin.rhtml, the closing paragraph tag for the link_to “Products” link should be
instead of
2006-05-07
59
TYPO
At the very top of the page:
work> cd depot
work> ls -p
After changing to depot, the prompt should change to depot> (as it does in the next prompt later on the page)
(Dave says: good catch!)
2006-05-07
134
TYPO
In the command line output on this page, you have typed “rake db:migrate” twice:
It should be either one or the other. Judging by the examples in the rest of the book it should be the first.
2006-05-07
63
TYPO
(bottom of page) “…to indent the lines following depot_devlopment: …”
There’s a typo in the name of the database: “depot_devlopment” instead of “depot_development”
2006-05-07
64
SUGGEST
You say:
In reality, database connections work like a charm 99.9% of the time.
I know you mean to be encouraging, but it could actually be discouraging to a developer who sometimes has database issues… and let’s face it, that is not 1 developer out of every 1,000.
If things really worked well 999 times out of a thousand, would you have included a whole page with 10 possible errors to check? Each of those errors would only come up an average of 1 out of every 10,000 times! So maybe once among your readership. At that rate, you could include a warning just to me about my sticky up arrow key.
Awesome book. I am having a blast.
(Dave says: very good point)
2006-05-07
65
TYPO
(Middle of the page) " and with the file extension (..rb, because it’s a ruby program)"
There’s is two dots in the extension name: “..rb”
2006-05-07
161
TYPO
You give an example implementation of delete_user that has some problems. You talk about the problems, which is good. However, after discussing the problems, you do not give a revised implementation of delete_user. You can look at the login_controller.rb listing on pages 537-538 to get the final implementation but it would probably be better to include it here.
2006-05-07
40
ERROR
At the very bottom of the page you say that the code will output the time zone as “CST” When I run this code locally it prints out the full time zone name, as in “Central Standard Time”
(Dave says: I double checked, and I see the abbreviation)
2006-05-07
66
SUGGEST
You say “This uses a new command, rake.” but you did already use it earlier to test DB connectivity
2006-05-07
108
TYPO
The current text reads “is the exception is thrown” and I believe it should read “if the exception is thrown”
(If instead of is…)
2006-05-07
130
TYPO
To do that, let
2006-05-07
78
TYPO
(Middle of the page) “the code generated by the scaffold is indentical to”
Change “indentical” to “identical”
2006-05-07
82
TYPO
(Middle of the page) “(dropping the .css extension.”
The closing bracket is missing or the opening bracket needs to be replaced by a comma
2006-05-07
113
ERROR
The definitions for empty_cart and redirect_to_index should match the code listing on page 539. In particular, the redirect_to_index method is used throughout the book with an optional message which does not work with the definition on page 113.
(Dave says: it doesn’t need it at this point. That’s added later)
2006-05-07
125
TYPO
“let’s flash it’s background” should read “let’s flash its background”
2006-05-07
168
ERROR
In creating a Rest Interface, you should preface the “script/generate controller info” command with “ruby” since you cannot count on the #! line in script/generate to be right.
2006-05-08
178
TYPO
(First line) “when we created the development databases for the Depot application”
“databases” should be singular
2006-05-08
179
SUGGEST
(Middle of the page) “We can use the model’s valid?() method to check to see if it validates”
IMHO we have to choose between “to check” or “to see” :)
2006-05-08
181
OK
(First line) “and we verify the error message associated with the price attribute is what we expect”
should be “and we verify that the error message”
2006-05-08
184
TYPO
(Using Fixture data: second paragraph) “However, Rails makes it easier that that”
replace the first “that” by “than”
2006-05-08
188
TYPO
(Paragraph just before 13.3) the phrase “but these tend be be used infrequently used” should be replaced by “but these tend to be infrequently used”
2006-05-08
189
OK
(Middle of the page) “Rails is populating a response object behind the scenes.”
“scenes” should be singular
(Dave says: this one I’ll leave to the copt editor…)
2006-05-08
80
ERROR
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:
(Dave says: This is a change to scaffolding in 1.1.1. Fixed)
2006-05-16
195
TYPO
The following occurs twice in a row on the page; I think either it is a duplicate line that needs to be removed, or the second line is supposed to be different, but was not editted to reflect this:
assert_tag(conditions)
assert_tag(conditions)
2006-05-08
80
SUGGEST
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.
2006-05-07
209
TYPO
First paragraph of the page, last sentence is:
"We
2006-05-08
199
SUGGEST
The script/generate command should be preceeded with “ruby” since you can’t count on the #! line to be correct
2006-05-08
31
SUGGEST
For ISP’s you could suggest people look at the following page as a starting point
In the keeping up to date section, after the gem update command. It might be a good idea to suggest using “gem cleanup” or whatever that command is. It took me a while to learn about this and I had many gem versions sitting on my computer. This made the first html page of the gem documentation cluttered with all sorts of versions.
(oops, posted this under page 41 as well which was wrong.)
2006-05-07
48
SUGGEST
Let
2006-05-07
48
SUGGEST
The brief discussion of what symbols are does not help me understand them. I have read the discriptions of symbols in Pickaxe and AWDWR and still do not have a real idea of what they are. I’m sure many programmers like me are coming from languages without a symbols analogy. I would love it if you spent a little more time on what symbols are and how they relate to strings. I know this is not a Ruby book but Rails uses symbols all the time and I feel a little whimpy without an intuative understanding of symbols.
2006-05-07
67
OK
“scaffold :product” You refer to this as a scaffold declaration. The word delaration is not really appropriate. It makes me think “int a;”. This is a call to the scaffold method, just a plain old Ruby method. It could be written as “scaffold(:product)”. This same type of thing confused me for a while with “has many :employees” or “validates_presence_of :name”. I didn’t know these were just plain old Ruby methods. I thought they were some sort of Rails voodoo. Perhaps you could write something like “This is just a call to the scaffold method provided by the Rails framework. It could be written as scaffold(:product)”
(Dave says: I’m thinking that’s too much detail at this point)
2006-05-07
209
TYPO
In the second paragraph, third sentence, you have the word “valud” instead of “value”. It should read, “… if we pass 0 as the id value to MySQL…”.
2006-05-08
64
TYPO
“you can define database migrations..”. Then phrase ends with two dots.
2006-05-07
66
SUGGEST
The info:
Rake looks for all the migrations not yet applied to the
database and applies them.
How do you know which migration has not yet been applied? I’d find this useful to know at this point.
2006-05-07
123
TYPO
then replace it
2006-05-07
177
TYPO
the code in the auto-generated product_test.rb should read “fixtures :products” instead of “fixture :products”
2006-05-08
125
TYPO
Whenever an item is the cart is updated (either when it is added or when we change the quantity) let
2006-05-07
149
TYPO
the text:
to validate you typed what you thought
you typed?
There appears to be a typo here.
2006-05-07
108
TYPO
“instructs the browser to immediate request the URL …” ‘immediate’ should be ‘immediately’.
2006-05-07
125
TYPO
“In then fades back” should be “It then fades back” on the first line of text.
2006-05-07
136
OK
_cart.rhtml on this page uses the older button_to instead of form_remote_tag code we replaced button_to with earlier in the book.
(Dave Says: I don’t see a prior _cart.rhtml using form_remote_tag. What am I missing?)
2006-05-07
126
ERROR
It seems that implementing the AJAX “Add to Cart” does not deal with the “Your cart is currently empty” flash if you had previously emptied your cart. Since there isn’t a form post (due to using AJAX) the flash stays on the screen even when you clearly have items in your cart. Being new to Rails I don’t know the proper solution but I “fixed” it by adding page[:notice].hide to my add_to_cart.rjs. I recognize that as a quick fix and probably not the most appropriate but I’m still learning Ruby and Rails.
2006-05-23
108
TYPO
Change “you access the flash as it it were a hash.” to “you access the flash as if it were a hash.”
2006-05-08
10
SUGGEST
The anchor to figure 2.1 redirects to the text below 2.1. It would be nice to be redirected to the top of the page (top of figure 2.1) there, to have the figure displayed when clicking on the reference to it. (instead of being thrown to the subtitle of the figure and having to scroll up)
(Dave says: Sorry, not much I can do about this—the link is to the caption)
2006-05-22
107
TYPO
“A flash is a bucket (actually closer to a Hash), Into which you can store stuff as you pro-cess a request.”
Probably better as:
“A flash is a bucket (actually closer to a Hash), in which you can store stuff as you pro-cess a request.”
2006-05-22
131
TYPO
In second to last paragraph, “track done what changed” should be “track down what changed”.
2006-05-22
125
TYPO
"an
element" should be "a
element"
2006-05-22
1
OK
At source code file, “depot_final” folder doesn’t have all migrations files.
(Dave says: depot_final isn’t code referenced from the book: I use it as a placeholder. depot_r is the latest ‘real’ version’)
2006-05-09
105
OK
"If we were rolling the Depot application into production, we
2006-05-09
131
TYPO
2nd to last line on page “I have JavaScript enabled in oe…” should read “I have JavaScript enabled in one…”
2006-05-22
86
SUGGEST
in the store index.html view you include the following code:
<% for product in @products -%>
There is no indication into why you end the code with a minus sign. Is this a special erb thing, or is it part of your code? It’s not obvious :-)
It might be an interesting idea to write the excerpt as ruby code, with comments to where you want the output to go e.g. something like (I know this isn’t that correct..):
for product in @products
#choose css class
#output image
#output product title
#output product description
#output product price with css class price
end
which would allow the reader to get a good feel for the structure of the code before all the clutter of the html is added.
2006-05-16
120
TYPO
I don’t understand your explanation, Dave. You say:
“I shows the updated version of redirect_to_index instead”
Where in the book is this updated? Here’s the code on this page:
def add_to_cart
begin product = Product.find(params[:id])
rescue
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
else
cart = find_cart cart.add_product(product)
redirect_to_index
end
end
One version of redirect_to_index is taking an argument, one isn’t. Throws an error for me.
2006-05-22
160
SUGGEST
In last paragraph, it mentions adding the layout directive to the login controller. We’ve already done that on p. 153, but the text makes it sound like it’s the first time we’re learning about this. I like the idea of reiterating the point with additional background info, but perhaps an acknowledgement that the layout directive should already be in the code would make it clearer.
2006-05-22
161
SUGGEST
Should the link_to for delete_user be a button_to instead?
2006-05-22
73
SUGGEST
“You might…when developing.” The end of paragraph 6.2 has already stressed this point, so this seems superfluous.
2006-05-16
113
SUGGEST
Just a consistency point.
In add_to_cart.rhtml you use the variable `cart_item` as a placeholder for all the cart_items in the cart:
<% for cart_item in @cart.items %>
yet on page 99 you use `item` as the variable name:
<% for item in @cart.items %>
Is there any real reason for this? If not it might be nice to keep them the same - either one is nice, although I personally prefer the more verbose `cart_item`. :-)
2006-05-22
80
SUGGEST
It might be useful to clarify what %{} does.
2006-06-12
87
TYPO
“Figure 7.1 .” There’s a leading space before the dot.
2006-05-29
89
TYPO
“on page ??.)” The closing paranthesis was never opened.
2006-05-22
89
TYPO
“Figure 7.2 .” There is a leading space before the dot.
2006-05-29
101
ERROR
<%= item.title %> should probably be <%= h(item.title) %> as in the index view. Same goes for later listings of the add_to_cart view.
2006-05-22
132
TYPO
The title should not be task D: Checkout but task E: Checkout…
2006-05-22
136
TYPO
2nd paragraph:
Just what to these various declarations do? -> Just what do these various declarations do?
2006-05-22
118
SUGGEST
“Remember how the render with the collection option inside the add_to_cart template set the variable cart_item inside the partial. It turns out we can do the same when we invoke a partial.”
This is rather a complicated couple of sentences. Would it be possible to break them down into more digestible chunks? Something like the following would be nice:
Remember the ‘render with collection option’ that we used inside the add_to_cart template? That render option set the variable cart_item inside the partial for us automatically. It turns out we can also do this explicitly when we invoke a partial.
2006-05-22
119
SUGGEST
I like your use of an arrow to indicate the new part of the code. However it only seems to be pointing to the line:
The object name is incorrect in the last paragraph, sentence 5. "Let
2006-05-22
126
ERROR
Another code inconsistency.
Your code in the _cart_item.rhtml partial references what looks like an older version of the `format_price` helper. The example given on page 126 is as follows:
<%= cart_item.quantity %>×
<%= cart_item.title %>
<%= number_to_currency(cart_item.price/100.0) %>
whereas when introduced on page 117 it was as follows:
placing the arrow on the centre line indicating that it was new. You haven’t indicated why you place this blind_down effect between the other two statements. Is order important here? Otherwise why not put it at the end?
2006-05-22
120
ERROR
Looks like redirect_to_index(message) maybe should be rewritten as redirect_to_index(message=nil). Otherwise if you call redirect_to_index without any argument as you do on this page, you get a missing argument error.
2006-05-22
98
TYPO
The text after the index.rhtml code suggests using <h …> regularly, but the code itself uses the h(…) construct. It’s easy to figure out what’s going on, but the discrepancy made me go back and re-read the text and try both methods to confirm that one or the other wasn’t a typo.
2006-05-22
314
ERROR
Maybe I missed it, but I think the “dont_destroy_dave” method got removed from the Depot application: I worked through the whole thing and never added that code. The text says that we’ve already seen this callback in action, which I think got removed.
(Dave yes: yes—you’re reading a version 1 chapter here)
2006-06-12
135
TYPO
“To do this, we use the belongs_to( ) declaration twice the line_item.rb file.” at the bottom of the page doesn’t seem to make sense.
Looks like there’s a missing ‘in’:
"To do this, we use the belongs_to( ) declaration twice IN the line_item.rb file.
2006-05-22
137
SUGGEST
I struggled to understand some of the concepts presented on this page:
“As this form will have to link back into a Rails model object,”
I don’t quite understand what this means, it assumes that I know why the form links to a model object. I guess it means that the data captured by the form will be manipulated within Rails by a model object, but I’m not sure.
“However, consider the general case. Maybe we want to edit an existing model. Or maybe the user has tried to enter an order, but their data hase failed validation. In these cases, we want any existing data in the model shown to the user when the form is displayed.”
This section required a number of re-reads before I understood that it was talking about auto-populating the form with existing model data. To me it would make sense that you introduce the concept and then explain why it is useful:
We also might want to auto-populate a form with existing model data. There are a couple of reasons for this. Firstly, we might want to create a model with default values, and have these values visible when the form first loads. Secondly, the user might have tried to enter an order, but their data failed the validation procedures, and on reloading the form we don’t wish to lose the information they have already entered.
2006-05-22
138
SUGGEST
"However, simply knowing the name of the object isn
2006-05-22
141
SUGGEST
"Before we move on to that new action, though, let
2006-05-22
157
SUGGEST
We are told to edit the index, but that action was not specified when we generated the login controller.
“The template is in the file index.rhtml
in the directory app/views/login.”
2006-05-22
80
ERROR
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
2006-05-16
123
ERROR
Using Rails 1.1.2, I couldn’t get the add_to_cart.rjs to work as written:
page[:cart].replace_html :partial => ‘cart’, :object => @cart
It did work when I changed to
page.replace_html ‘cart’, :partial => ‘cart’, :object => @cart
(Dave says: I checked here, and with the core team. The first form should work with 1.1.2)
2006-05-22
153
SUGGEST
“It falls through to the end, and renders the form associated with add_user”
would it not be clearer to say that it renders the view associated with add_user?
2006-05-22
181
SUGGEST
you’re passing more than one parameter to the assert statement:
yet you don’t explain what these parameters do. It would help a lot if you could spend some time explaining the various assert statements, and the parameters they can take. :-)
2006-05-28
184
TYPO
Testing the Cart: fifth paragraph “…a cart, it check to see” -> “…a cart, it checks to see”
2006-05-22
89
OK
Perhaps you should note that ‘@content_for_layout’ has been deprecated in favor of ‘yield’?
Dave says: Actually, it hasn’t. Marcel mispoke in the blog entry.
2006-05-16
202
SUGGEST
assert_success() is deprecated so it should not be used anymore…
in my case it’s located in /actionpack-1.12.1/lib/action_controller/deprecated_assertions.rb
2006-05-22
80
OK
When I did this, the scaffolding generated code using
@products_pages
not
@product_pages
(Dave says: Perhaps you typed ‘products’ on the command line?)
2006-05-16
115-131
SUGGEST
Throughout this section (Task D) of the tutorial, “Empty Cart” button remains untouched. This seems to be a serious deficit in our application, as it can leave the notice “Your cart is currently empty” and have the content of the cart shown in the side bar. This problem should become clear quite early (as early as at the end of the iteration D2). I suppose you can “leave it as an exercise for the reader”, but at least you should acknowledge this shortcoming.
2006-05-22
209
TYPO
"we
2006-05-22
187
SUGGEST
As well as having a description of the asserts, would it be at all possible to have simple examples of them?
2006-08-27
76
OK
validates_format_of :image_url,
:with => %r{\\.(gif|jpg|png)$}i,
:message => “must be a URL for a GIF, JPG, or PNG image”
is there any chance that you could briefly explain what you’re doing here with the -n flag, and why you need to pass it test_index?
2006-05-22
141
TYPO
Footnote 5, first sentence.
“…, given that it’s value comes ….” should read
“…, given that its value comes ….”
2006-05-22
136
TYPO
It’s late and maybe I’m being dumb, but I don’t get this sentence:
We
2006-05-22
96
ERROR
Next to the line
# (create the session table with ‘rake create_sessions_table’)
There’s a margin comment, “see if they update env.rb with new task names”
They did. The line in my rails project is
# (create the session table with ‘rake db:sessions:create’)
2006-05-22
131
OK
Isn’t content_for_layout being replaced by yeild?
- <%= @content_for_layout %>
+ <%= yield %>
(Dave says: no)
2006-05-17
108
SUGGEST
after rake db:session:create, I had to rake db:migrate to let the changes make effect. Didn’t see this in the book.
2006-05-22
147
TYPO
Iteration F1 should be E1, etc. now that chapter is renamed Task E: Administration.
2006-05-23
116
OK
Technically speaking, a Ruby method isn’t invoked. Instead, a message is sent to an object which may be handled by a method. Because Ruby takes this to the extreme, it may be worth mentioning to Nuby’s lest they gasp at the missing 1-to-1 link present in so many other languages.
(Dave says: that’s really just semantics: a method is indeed invoked, and the message sending metaphor (which I believe I introduced in the PickAxe) is actually more confusing than not to newcomers)
2006-05-17
119
SUGGEST
<%= render :partial %> or <%= render(:partial) %> (see preceding pages)? Sticking to one notation would help overall consistency.
Another note on consistency: this is the first time that I’ve seen you use single-quoting, which may strike some readers.
2006-05-22
131
TYPO
“facailities” should read “facilities”
2006-05-22
133
TYPO
The URL to the ActiveMerchant library isn’t hyperlinked.
2006-05-22
150
TYPO
“of the form_for, it is automativally associated with the data”
automativally = automatically.
2006-05-22
11
TYPO
It is not "Tous les jours,
2006-05-22
39
TYPO
once youve chosen an editor => should read once you have chosen or once you’ve chosen
2006-05-16
153
OK
if request.post? and user.save
flash[:notice] = "User #{user.name} created"
@user = User.new
end
should be
if request.post? and user.save
flash[:notice] = "User #{user.name} created"
else
@user = User.new
end
(Dave says: no, this way it lets you create multiple users)
2006-05-22
126
OK
Well, I figured out one way to ensure the hiding of the “Your cart is currently empty” flash message when a customer adds a book to the cart. Be sure to add the “page[:notice].hide” line Jason suggested to the add_to_cart.rjs file (see comment above) AND modify the store.rhtml file in the layouts directory. Add the two lines indicated below:
<% if flash[:notice] -%>
<%= flash[:notice] %>
add-> <% else %>
add->
<% end -%>
<%= @content_for_layout %>
This ensures that the application will work the first time a user adds a book to the cart, bypassing the error I mentioned earlier. I would have preferred to add an if clause to the .rjs file, but nothing I tried worked. Any suggestions?
(Dave says: Yup: look at the end of the checkout chapter for an example.)
2006-05-23
75
OK
In the footnote (6) from the previous page you say "With other databases, the value might come back as a string, so you
2006-05-22
162
TYPO
just deleted the only administrative used from the system
should be
just deleted the only administrative user from the system
2006-05-22
81
ERROR
The scaffold-generated controller code requires a POST to destroy content, but your sample list.rhtml code generates a GET URL. It took me a while to figure out why it was silently not deleting the table entries.
2006-05-16
131
TYPO
And, as we saw, startign with a conventional application mkes
should be “…starting… makes”
2006-05-22
137
TYPO
but their data hase failed validation
2006-05-22
156
SUGGEST
in the login action of login controller, how to redirect to the original referrer?
i.e. when try to access “admin/list” I should be taken to “login” and back to “admin/list”
If I login from “login/login” then I should be taken to the list?
I have stored the original referrer information in session and used this information to redirect. But the code looks ok…is there a better way?
2006-05-22
67
TYPO
In paragraph starting “Using your favorite editor..” file admin_controller is referenced without extension “.rb” - extension should be there for clarity.
2006-05-22
73
SUGGEST
In the footnote: “Remember.. cents..” Actually, I don’t remember any mention of the price being stored in cents. Either point this out when the column is added or motivate here why you want to use cents rather than dollars. [cents will not allow micro payments, though :-)]
2006-05-22
114
TYPO
Hmmm…let
2006-05-22
92
TYPO
“See the discussion starting on
page 380 on page ?? for some more background” -> on page is repeated.
2006-05-22
209
ERROR
class OrderController; def rescue_action(e) raise e end; end
should be;
class StoreController; def rescue_action(e) raise e end; end
2006-05-22
1
TYPO
ORIGINAL:
Rails went from being an unknown toy to being worldwide
phenomenon.
CORRECT (Change between <<>>):
Rails went from being an unknown toy to being <> worldwide phenomenon.
2006-05-22
108
TYPO
It allows us to specify one path through the action is the exception is thrown, and other if it isn
2006-05-22
136
TYPO
“delcarations” should read “declarations”
2006-05-22
553
ERROR
The “depot-form” selectors should be IDs instead of classes for them to work properly (at least in Firefox). i.e. replace all occurances of “.depot-form” with “#depot-form”.
2006-05-23
146
TYPO
Underneath “What We Just Did”, the first bullet item has a trailing dot but the second and third haven’t. Also, “we did the following” might use a trailing colon instead of a dot.
2006-05-22
79
TYPO
ORIGINAL
It turns out that we can: migrations to the rescue.
Problem:The colon next to can isn’t right.
2006-05-22
151
SUGGEST
There’s a fair bit in here that wasn’t in the previous pages. safe_delete wasn’t introduced before, nor were create_new_salt and encrypted_password declared private.
2006-05-22
163
ERROR
The code for safe_delete is already shown on PDF page 151, so the user may have typed this in already meaning that they wouldn’t be able to delete the last admin.
2006-05-22
126
SUGGEST
“rendering is the one that was just changed.” -> “rendering is the one that just changed.”
The first footnote in 12.1 could benefit from some pointers as the reader may also be interested in reading more about the mentioned four topics, namely SOAP/XML-RPC client/server.
So we could have a few page numbers here.
(Dave says: It’s likely we’ll be losing the web services chapter…)
2006-05-22
1
TYPO
‘l33t’ on the 5th or 6th line. Perhaps it is just personal opinion, but l33tsp34k(leetspeak) doesn’t exactly reek of professionalism. I wouldn’t use it in an official email, much less in a book; but that’s just me. :)
(Dave says: ah, I don’t write that kind of book :)
2006-05-22
27
TYPO
Section “The Desktop”, final paragraph, fourth line from the bottom: s/can can/can/
2006-05-22
27
SUGGEST
Replace the “wicked which” in the next-to-last line: “a Ruby library that conntects”.
2006-05-22
20
TYPO
Line 5 from the bottom: s/50 Mb/50 MB/
2006-05-22
79
TYPO
The footnote begins with “Rather that”
It should be “Rather than”
2006-05-22
120
TYPO
The spacing in the text below the screenshot is off. I see “The cart’s inthe sidebar” when it should be “The cart’s in the sidebar”
2006-05-22
138
TYPO
“with an object names ”order." " should be “with an object named ”order." "
2006-05-22
147
TYPO
depot> script/generate model user
should be
depot> ruby script/generate model user
2006-05-22
26
SUGGEST
In the list of editors, jEdit would be a good choice to include. With the addition of its SuperAbbrevs and Console plugins, jEdit can do a lot to help Rails developers be more productive. See, for example, http://saimonmoore.net/permalink/jedit-for-ruby-rails-development for details.
2006-05-22
24
ERROR
The locomotive link runs off the right side of the page and is outdated. I’m using Preview under Mac OS X 10.4.6.
2006-05-22
205
TYPO
“a use at a browser interacting” -> “a user at a browser interacting”
2006-05-22
182
TYPO
After test code, first sentence, "Here we
2006-05-22
1
SUGGEST
You may want to add a footnote about the text "It isn
2006-05-22
230
SUGGEST
While I don’t know if you’ve got plans to change this section I think the “You might be able to use the -s option when you run breakpointer to connect to an application on
another machine.” is very vague. It would be nice to give a better explaination of why you “might” be able to.
2006-08-24
87
TYPO
“… sidebar on this public-facing pages.” should be “… sidebar on the public-facing pages.”
2006-05-22
113
TYPO
One extra period in sentence "We can implement one using Ruby
2006-05-22
39
TYPO
permentently => permanently
2006-05-22
67
TYPO
first line: appplication
2006-05-22
521
OK
Hashes and Parameter Lists
Add a converse line of code to show a call made with a hash instead of showing one without.
(Dave says: this call already shows a hash being passed)
2006-10-04
149
SUGGEST
Perhaps it might be worth mentioning that digest/sha1 is required for the snippet to work. Otherwise, users may overlook the require in the code listing later on.
2006-05-22
66
SUGGEST
Shouldn’t the database columns be set NOT NULL? After all, you do perform a validates_presence_of later on. (Same goes for all later migrations and database tables too.)
(Dave says: possibly, but I wanted to keep it simple for now)
2006-06-12
147
SUGGEST
About the reference to Rails Recipes: it’d might be interesting to note why a reader would also consult RR when a fine authentication recipe is provided here already.
(Dave says: because RR also has a role-based recipe)
2006-05-22
150
SUGGEST
It might make sense to rename the login action in user.rb to authenticate. Technically, no session login occurs and it also prevents confusion with the login action in the LoginController later on.
2006-05-22
27
TYPO
Aracho Ruby -> Arachno Ruby
2006-05-22
96
TYPO
The sentence “It you now look at the database…” should read “If you now look at the database…”
2006-05-22
96
ERROR
A previous errata already identified the typo for the session create command to correctly be
rake db:sessions:create
However, this only creates a migration file and does not automatically create the session table as the book implies. The session table only comes into existences once
rake db:migrate
is executed.
2006-05-22
60
ERROR
The cursor changes to a pointer finger when mousing over the top third of the page. The underlying link reference is invalid.
(Dave says: Could someone email me a screenshot of this problem: I just dan’t see it here. dave at pragrog.com)
2006-05-23
61
TYPO
… if you’re decided to rebel …
should be
… if you’ve decided to rebel …
2006-05-22
64
TYPO
… once you’ve go Rails …
should be
… once you’ve got Rails …
2006-05-22
66
TYPO
… so that in looks like the following …
should be
… so that it looks like the following …
2006-05-22
117
SUGGEST
The explaination of how a partial assign an element of a collection to a variable is very confusing.
"That
2006-05-22
163
ERROR
Shouldn’t we see the code that actually uses the safe_delete helper at this point?
2006-05-22
62
ERROR
The command “rake db:migrate” is failing with this error:
No such file or directory - db/schema.rb
Is it possible that we have to do “script/generate migration” before running that command?
BTW,
marklar:~/src/learn/agilebook/depot max$ uname -a
Darwin marklar.local 8.6.0 Darwin Kernel Version 8.6.0: Tue Mar 7 16:58:48 PST 2006; root:xnu-792.6.70.obj~1/RELEASE_PPC Power Macintosh powerpc
(Dave says: this is probably a database configuration issue, as it seems to work fine here)
2006-05-22
78
OK
the command “ruby script/generate scaffold product admin” terminates with the following error:
No such file or directory - script/../config/../app/views/layouts/admin.rhtml
The scaffolding seems to work, although the CSS stylesheet doesn’t seem to exist. I’ve been building the project by hand and there’s not app/views/layouts folder
(Dave says: the ‘rails’ command creates it)
2006-05-22
97
TYPO
… for an array of atems. When …
should be
… for an array of items. When …
2006-05-22
107
TYPO
Section 8.3 is called Iteration C2 and Section 8.4 is also called Iteration C2
2006-05-22
68
TYPO
on the footnote where it reads “application from Chaptera 4.” it should read “application from Chapter 4.”
2006-05-22
121
TYPO
At the very botton, it should say “…open up index.rhtml in the app/views/store directory…”
2006-05-22
127
TYPO
see typo “…on the transition between and cart that’s empty”
2006-05-22
129
SUGGEST
In the first paragraph, the sentence “We’d use it in the store layout like this.” coupled with "For now, we’ll keep
2006-05-22
184
SUGGEST
Perhaps use ActiveRecord::Errors.default_error_messages[:taken] instead of “has already been taken” in the following line of code:
assert_equal “has already been taken”, product.errors.on(:title)
2006-05-22
139
SUGGEST
Footnote says: “Rails provides good support for generating
selection lists in this context too”. Maybe an example?
2006-05-28
55
TYPO
Second paragraph: There’s a spurious space character between the reference to “Figure 5.2” and the following comma.
2006-05-29
56
TYPO
Third paragraph: There’s a spurious space character between the reference to “Figure 5.3” and the following fullstop.
2006-05-29
63
SUGGEST
The list of possible errors of “rake db:migrate” should be extended for the message “No such file or directory - /tmp/mysql.sock”. On OpenSUSE (10.0), this file is /var/lib/mysql/mysql.sock. After setting a soft-link to /tmp, the DB test succeeds. (Answer found in the ROR wiki.)
2006-05-28
75
OK
I guess that your customer will bark at the “integer test” for the price after having to enter, say “2395” instead of “23.95”. How could she let this slip through Iteration A3?
(Dave says: she was probably drunk)
2006-05-23
83
TYPO
First bullet point: We created a development database […] to access it.
2006-05-28
24
OK
The two links that appear on this page cross the margin right border. Also, the first line of the 3.4 section has grown to more than the width of the complete text area.
(Dave says: all layout issues are address just before final printing)
2006-05-28
3
SUGGEST
Undefined acronym “RESTful”
Also, ???
- It turns out the best way
+ It turns out that the best way
2006-05-29
111
TYPO
duplicate word ‘on’
"We
2006-05-28
191
TYPO
Footnote: Should “assert_directed_to()” be “assert_redirected_to()”?
2006-05-28
217
SUGGEST
Did I miss the step where DAVES_DETAILS was defined?
2006-05-28
141
TYPO
“Now for the template itself.”
=> “Now, for the template itself.”
2006-05-28
141
TYPO
“Maybe we want to edit an existing model. Or maybe the user has
tried to”
The sentence just ends and the next line begins mid-sentence.
2006-05-28
142
TYPO
“The first parameter, :order tells…”
=> “The first parameter, :order, tells…”
2006-05-28
241
TYPO
Section 15.1 - “allow them to be send” should be “allow them to be sent”.
2006-05-29
228
TYPO
“so after freezing your application …” should be “so after freezing, your application …”
2006-05-29
145
SUGGEST
"Let
2006-05-28
146
SUGGEST
In ‘Joe Asks…’ section.
"Joe
2006-05-28
146
SUGGEST
“If the save succeeds, we delete the cart from the session ready for the next order and redisplay the catalog, using our redirect_to_index( ) method to display a cheerful message.”
=> “If the save succeeds, we do two things. First, we ready ourselves for this customer’s next order by deleting the cart from the session. Then, we redisplay the catalog using our redirect_to_index( ) method to display a cheerful message.”
“If instead the save fails, we…”
=> “If, instead, the save fails, we…”
(Dave says: much better wording. Thanks!)
2006-05-28
224
SUGGEST
Could you elaborate why components are considered deprecated? As a former Rails 1.0 user and buyer of Agile Rails 1.1 I am quite interested in the changes of the framework.
(Dave says: I’ve added a section to Action Pack)
2006-05-28
224
ERROR
As I figured out the rake-rdoc is not generated for code living inside the lib/ directory. Maybe you could explain the reason for that (or give a solution to it)?
(Dave says: It qwill include lib/ as of 1.1.3)
2006-05-29
224
OK
Is there a way to make classes or modules reloadable in development mode if they are located in the lib/ directory?
(Dave says: I believe not)
2006-06-12
49
TYPO
In the rhtml:
Time to say
<%= link_to “GoodBye!”, :action => “goodbye” %>
<<link_to “GoodBye!”>> s.b., <<link_to “Goodbye!”>>, to match the (correct) spelling elsewhere.
2006-05-28
56
TYPO
- Overspecify it upfront
+ Over-specify it up front
(Dave says: I’ll let the copy editor worry about this one :)
- It should be the same as the name of the database
you created using mysqladmin.
+ It should be the same as the name of the database
you created using your database administration tool.
2006-05-28
64
OK
This sentence got scrambled with another:
If you see the error Before updating scaffolding from
new DB schema, try creating a table for your model (Product), it may well be because Ruby (and hence Rails) can
2006-05-28
60
TYPO
Footnote: s/ad nauseum/ad nauseam/
2006-05-28
90
TYPO
The reference to “Figure 7.1” has a spurious space character before the following fullstop.
2006-05-29
92
TYPO
The reference to “Figure 7.2” has a trailing space character before the following fullstop.
2006-05-29
73
OK
In the footnote, you said “Remember that we’re storing the price in the database in cents”, but I didn’t find any reference to that election before this page.
(Dave says: It’s in the sidebar two pages befoee)
2006-05-28
74
OK
The footnote is splitted in two pages. Probably the best way is to have all the lines in the same page.
(Dave says: we do layout at the end)
2006-05-28
41
TYPO
Normally, this doesn
2006-05-28
81
OK
If you didn’t stop the webrick server after adding “scaffold :product” line at the app/controller/admin_controller.rb file, the new list.rhtml view won’t be rendered, because webrick seems to use still old scaffold functions.
(Dave says: seems to work OK for me. Does anyone else see this?)
2006-05-28
102
TYPO
“Rails complains. Let’s make it happy by writing…”
2006-05-28
79
TYPO
In "So far, the only code we
2006-05-28
243
TYPO
First paragraph: “adds some hhelper methods to strings” - “hhelper” should be “helper”
2006-05-29
227
TYPO
Last paragraph, first line. “…,you want want to consider…” should read “…, you may want to consider…”
2006-05-29
227
TYPO
Last paragraph, third line. “…, six months from they, …” should read “…, six months from now, …”
2006-05-29
229
TYPO
In section “Linking Your Project to the Rails Repository”, the last word on the line just below the code example “svn up vendor”: “From now one, …” should read “From now on, …”
2006-05-29
230
ERROR
Third paragraph in “Runtime Environments” section (and following command-line examples): "If you
2006-05-29
109
TYPO
The reference to “Figure 8.4” has a trailing space character.
2006-05-29
116
TYPO
Another trailing space after “Figure 8.5”.
2006-05-29
131
TYPO
…“The scipt.aculo.us effects library”…
sc*r*ipt.aculo.us
2006-05-28
219
TYPO
duplicate then “It then then reopens the PaymentGateway” 7 lines from the end of the page.
2006-05-28
141
SUGGEST
The unexpected line break looks like you were looking at my suggestion for the previous edition:
“However, consider the general case. Maybe we want to edit an existing model. Or maybe the user has tried to enter an order, but their data hase failed validation. In these cases, we want any existing data in the model shown to the user when the form is displayed.”
This section required a number of re-reads before I understood that it was talking about auto-populating the form with existing model data. To me it would make sense that you introduce the concept and then explain why it is useful:
We also might want to auto-populate a form with existing model data. There are a couple of reasons for this. Firstly, we might want to create a model with default values, and have these values visible when the form first loads. Secondly, the user might have tried to enter an order, but their data failed the validation procedures, and on reloading the form we don’t wish to lose the information they have already entered.
2006-05-28
115
OK
My suggestion was in the errata for the previous version, yet I can’t see any change, hence I’m suggesting it again. Ignore it if you think it’s too pernickity!
ust a consistency point.
In add_to_cart.rhtml you use the variable `cart_item` as a placeholder for all the cart_items in the cart:
<% for cart_item in @cart.items %>
yet on page 99 you use `item` as the variable name:
<% for item in @cart.items %>
Is there any real reason for this? If not it might be nice to keep them the same - either one is nice, although I personally prefer the more verbose `cart_item`. :-)
(Dave says: I don’t see this: it seems consistent (cart_item) here. Please e-mail me if I’m missing something)
2006-05-28
150
TYPO
Just after, the hide the
that contains the “flah” should probably be “flash”
2006-05-28
106
OK
I did not get the exception, “depressingly illustrated in Figure 8.2”, instaed everything just worked. The old session was apparently already deleted when restarting application.
(Dave says: it wouldn’t be. Perhaps you hadn’t previously added something to the cart, in which case the session wouldn;t have out-of-date data)
2006-05-28
201
TYPO
In the “Assertions” list, this assertion appears:
assert_response(type, message=nil)
For consistency, this should probably simply read:
assert_response(type, message)
… with “message” in italics (like the other assertions in the list)
In the add_product listing there is one extra ‘end’ which should be deleted
2006-05-28
130
OK
The RJS example should do a conditional page.hide on the flash #notice div if it exists, otherwise you add something to the cart and the “your cart is empty” notice is still there.
Also it would be a good idea to discuss the fact that offloading the add_to_cart functionality into an RJS file breaks the app if javascript is turned off - instead of degrading gracefully, it renders the javascript onscreen in the browser.
(Dave says: See later for both…)
2006-05-28
118
TYPO
… lets revisit out layout.
to
… lets revisit our layout.
2006-05-28
144
ERROR
The current CSS file in both the book and source files has the depot-form id set to classes, as in the following:
.depot-form fieldset { … }
The source code that is generated gives the depot-item div an id, not a class. I had to go and change the CSS file to reflect that the div contained an ID and not a class.
(Dave says: I believe the latest edition has them as classes (except for depot_r’ add_user form, which I’ve fixed)
2006-05-28
83
OK
The code for the links to the Previous page and Next page is equivalent to, but different from, the scaffolding code that’s generated automatically. It should match, unless there’s a good reason not to (which should be mentioned in the text).
(Dave says: I prefer to have shorter lines when I type stuff manually)
2006-07-13
81
TYPO
Footnote 9, to the images, results in a “Forbidden” page—I didn’t have access to the directory.
2006-05-28
89
OK
The find_products_for_sale method has “self.” in front of the method name, which is different from all other methods up to this point. Either it’s extraneous/wrong, or it should be explained.
(Dave says: the annotation in the margin next to the example points to the explanation)
2006-05-28
225
TYPO
In 2nd paragraph you give example subdirectory lib/pdfstuff; after 4th paragraph the example of importing from that directory has an underscore: require “pdf_stuff/receipt_writer”.
2006-05-29
246
TYPO
* puts 20.minutes.until(“2006-12-25 12:00:00”.to_time)*
I think that the word “until” should be blue.
(Dave says: yes, it should, but our syntax coloring tool ain’t that smart… :)
2006-06-12
152
SUGGEST
About the footnote: it might be useful to elaborate why a reader should also take a look at Rails Recipes. Other than a shameless plug, what is the advantage on a technical level?
Dave says: because it show role-based authenitcation, too)
2006-05-28
182
SUGGEST
Halfway the page, you mention unit and functional tests. It might be useful to also prepare the reader for the bit about integration tests.
2006-05-28
183
SUGGEST
Not actually a typo, but an ending colon after “The first is the line” might be appropriate.
2006-05-28
186
TYPO
“Let’s write the full test” misses an ending colon.
2006-05-28
164
OK
In the listing of depot_q/app/controllers/application.rb seems to be missing a return “false”:
class ApplicationController < ActionController::Base
private
def authorize
unless User.find_by_id(session[:user_id])
flash[:notice] = “Please log in”
redirect_to(:controller => “login”, :action => “login”)
false # <—- HERE
end
end
end
Otherwise, the rendering of the page continues and and error is thrown
(Dave says: From the documentation: "Additionally, it
2006-05-28
137
SUGGEST
When talking about foreign keys, suggesting this [http://www.redhillconsulting.com.au/rails_plugins.html] would be a good idea i think. Not sure why it isn’t part of rails anyway?
(Dave says: I don’t like the way that plugin automatically adds constraints: I’d prefer always having to use :references. As to your second point: I agree)
2006-05-28
24
SUGGEST
An alternative to using package management on Linux could be ROROX (http://rubyforge.org/projects/rorox), which puts Ruby, Rails + dependencies + useful gems over a XAMPP (http://apachefriends.org/en/xampp.html) installation. It supports running Rails under SCGI within subdirectories of localhost, and supplies scripts for doing the necessary configuration. (I maintain the package, by the way.)
(Dave says: this is very cool. I’ll include it if it seems to have traction in a year)
2006-05-28
82
OK
The testdata contains para tags which show up in figure 6.5 Tidied up Pruduct Listing (p.85).
(Dave says: Tht is correct.)
2006-05-28
186
SUGGEST
The rest of book uses double instead of single quotes. For reasons of consistency it may be appropriate to stick to a single notation throughout the book.
2006-05-28
188
TYPO
“either Comma-Separated Value (CSV) format or YAML format.” The first “format” is superfluous.
2006-05-28
190
TYPO
“it’s title” should read “its title”
2006-05-28
190
TYPO
“compart” should read “compare”
2006-05-28
124
SUGGEST
"Remember that underneath the covers, button_to( ) generates an HTML
2006-05-28
161
TYPO
“This form is different to ones we’ve seen earlier” should be something like “This form is different FROM ones we’ve seen earlier”
2006-05-28
166
TYPO
the linked list_users.html is much different than the one in the PDF.
(Dave says: sorry—that code didn’t get reuploaded)
2006-05-28
168
SUGGEST
call me a dummy, but when i saw that we were writing a “helper ” (safe_delete), i headed straight for the helpers folder. is “helper” a bad word choice here?
2006-05-28
229
TYPO
“These Rake tasks take a version … and freeze them …” Is that grammatically correct?
(Dave says: this is an artifact of the formatting system: it doesn’t like missing cross references in footnotes :)
2006-05-28
126
TYPO
Last line of the third paragraph from the bottom: Remove the space character between “HTML” and “.”.
2006-05-28
144
TYPO
Trailing space after reference to “Figure 10.1”
2006-05-29
73
OK
How do I add the price column in a different order (e.g. after the title)?
I usually expect that one book can’t answer all my questions, but I really appreciate it when the author(s) add pointers to other references with more details, so I don’t have to spend days (sometimes weeks) looking for answers to questions I might have after reading a book.
(Dave says: I don’t believe you can. I also don’t really see why it would matter..)
2006-05-28
75
TYPO
version of our code,x too.
2006-05-28
154
OK
Running this code gives me a “NoMethodError in Login#add_user”, undefined method ‘name’ for #
If I delete the <%= form.text_field :name, :size => 40 %> line from my code, the form gets at least loaded…
(Dave says: that means your users table doesn’t have a column called name)
2006-05-28
150
TYPO
Two lines above the second code inset: s/eihter/either/
2006-05-28
82
SUGGEST
If you have added a product that matches the name of one of those in add_test_data, it won’t be updated when rake db:migration is ran. I used the title from the example back on page 70 when I was told to add a product earlier in the book. I think a little more detail on the add_test_data and migration process works would be very helpful here (or at least a reference to where to find detailed info on migration).
(Dave says: isn’t this covered when we talk about vlidation: the validations we wrote check that you cann’t have duplicate names..)
2006-05-28
173
TYPO
has_many :orders, :through => :line_items
end
should be:
has_many :orders, :through => :line_items
….
2006-05-28
89
OK
In index.rhtml: <%= product.price %>
needs a:
inserted after it to get the same layout as Fig. 7.2
(Dave says: Not if you use the supplied test data, as it has
tags around the description)
2006-05-28
140
TYPO
2nd paragraph: “Because we added the belongs_to
declarion to LineItem” should be “Because we added the belongs_to declaration to LineItem”.
2006-05-28
192
OK
The two “cart.add_product rails” statements can be DRY’d by a little Ruby magic like “2.times { cart.add_product rails }”
(Dave says: They could, but I think it’s clearer laying them out in this case)
2006-05-28
190
SUGGEST
It could be real useful to provide a listing of Active Record’s built in error message table. I couldn’t find it documented anywhere but by looking at the source code.
2006-05-28
190
TYPO
“built in” should read “built-in” (look who’s talking :)
2006-05-28
195
OK
“…waiting for us in the test/functional directory.” Readability might be improved by ending the line with a colon instead.
2006-05-28
195
OK
About the “setup()” notation: many Rails developers are new to Ruby and might be struck by this notation. After all, where are the parameters in the method definition? Just writing “setup” might be less ambiguous and not necessarily wrong. (I’ve seen you use this on page 189 too.)
2006-05-28
84
TYPO
In the sidebar "What
2006-05-28
49
TYPO
change “thhow” to “how”.
2006-05-28
196
TYPO
“The assert_response() … was successful” misses a closing dot.
2006-05-28
197
TYPO
“logged-in” should read “logged in”.
2006-05-28
200
TYPO
“The parameters are as follows.” I know it’s a matter of style and I’ve whined about it previously, but it might be more correct to end that line with a colon instead of a dot.
(Dave says: I tend to leave these to the copy editor, but I’ve changed this (and others))
2006-05-28
201
TYPO
“functional-test assertions” should read “functional test assertions”.
2006-05-28
205
ERROR
I don’t think there is such a thing as “a browser field”. There’s a though, so perhaps this could be worded better.
2006-05-28
205
TYPO
“mime-encoded” should read “MIME-encoded”.
2006-05-28
200
SUGGEST
The “dave = users(:dave)” statements can be DRY’d in the setup method.
(Dave says: they could, but then I’d have to show it… ")
2006-05-28
192
SUGGEST
On page 207, you instantiate the products fixtures as ruby_book and rails_book. It would probably be more consistent and less ambiguous if you would here as well.
2006-05-28
210
TYPO
“but its still pretty readable”: “its” should read “it’s”
2006-05-28
212
TYPO
“integation” should read “integration”
2006-05-28
216
SUGGEST
A note on consistency: here you’re referring to the symbol :index whereas all your previous code uses the string ‘index’ for assertions.
(Dave says: let’s sneak in both uses… :)
2006-05-28
175
TYPO
Second line of next-to-last paragraph: “you enter the URL” — only one “the”
2006-05-28
210
SUGGEST
Since the source files are named dsl_ as well, it might be nice to note that the “minilanguage” in fact is a domain-specific language. Also, it might be more consistent to write either “minilanguage” or “mini-language” but not both (e.g. page 211).
2006-05-28
175
TYPO
Extra space after reference to “Figure 12.2”
2006-05-29
224
TYPO
Should “Which we do in the Pragmatic Programmer store” read “Which we have done for the Pragmatic Programmer store”?
2006-05-29
226
TYPO
“or WEBrick, We’ve been using this…” should read something along the lines of “or WEBrick, which we’ve been using…”
2006-05-29
229
TYPO
“Rail’s” should read “Rails’”
2006-05-29
229
SUGGEST
Now that Rails has a stable branch, linking to that one might be another option worth mentioning.
2006-06-12
230
TYPO
“Figure 6.1, on page 62 shows…” should probably read either “Figure 6.1 on page 62 shows…” or “Figure 6.1, on page 62, shows…”
2006-05-29
231
TYPO
Continuing my nitpicking :) - “dbfile” under “development_sqlite” is aligned with the entry above it, but no such alignment is present at “development_mysql”. Also, it might be more correct to end the line “Environment files typically do three things” with a colon.
2006-05-29
233
TYPO
“Then the following happens” should probably end with a colon (and I’ll now quit my enduring whining about colons by noting that lines signaling the start of a bulleted list should generally end with a colon).
2006-05-29
102
TYPO
in the last sentence of the paragraph following the graphic, change “tart” to “start.”
context:
Let
2006-05-29
213
SUGGEST
Page 213, last sentence: If the response is a redirect, follow it and any subsequent redirects, until a response that isn’t a redirect is returned.
2006-05-29
217
TYPO
First paragraph of section P&B: Use an em-dash (—-) in the next to last line, please.
2006-05-29
228
TYPO
2nd paragraph - “it simply tells your each of your application…” should probably be something like “it simply tells your application…”
2006-05-29
130
ERROR
Hiding the cart as directed did not work for me in IE7, while it did in Mozilla. Normally I wouldn’t have such a blind eye, but the problem occurred exactly as described on page 131, which led me to believe I had coded wrong and wasted time debugging: “… we see a flicker in the browser as the cart is first displayed, and then hidden and slowly revealed by the blind_down effect.”
(Dave says: this is an issue with IE quirks mode, and is fixed by including the correct DOCTYPE in the layout (which I didn’t have)
2006-09-22
182
TYPO
user_test.rb is missing from the unit listing and login_controller_test.rb is missing from the functional listing.
2006-05-29
63
TYPO
There’s a missing closing parenthesis near the bottom of the page: change
“(saying something like (in /Users/dave/work/depot), or”
to
“(saying something like (in /Users/dave/work/depot)), or”
2006-06-12
74
TYPO
The sentence starting with “How often have you implemented…” should probably end with a question mark.
2006-06-12
253
TYPO
“Figure 16.1 , shows”: there’s a space leading the comma, but I believe the comma can be omitted.
2006-07-14
141
TYPO
“Or maybe the user has tried to enter an order, but their data hase failed validation.”
=> ‘hase’ to ‘has’
2006-06-12
141
TYPO
End of page…
"Before we start on our final form, let
2006-06-12
144
TYPO
End of page…
"you
2006-06-12
145
TYPO
For consistency throughout text…
“…dropdown…”
=> “…drop-down…”
(Also in the footnote)
2006-06-12
vii
SUGGEST
“So Where’s Rails?”
=> “So, Where’s Rails?”
(Also change linked-to section header).
2006-06-12
157
SUGGEST
Perhaps a footnote that the \\ character in the generator statement is a shell command. Thought it might be part of the statement at first, which happily created a “\\.rhtml” file and a “\\” method in the login controller to no ill effect until several pages later.
2006-06-12
154
SUGGEST
Perhaps explain the presence of “wibble” in
string_to_hash = password + “wibble” + salt
which seems obscure.
2006-06-12
72
SUGGEST
You suggest the convention for migration names as follows:
depot> ruby script/generate migration add_price
But that doesn’t indicate which table we are adding the price column too.
Wouldn’t it be better to use:
depot> ruby script/generate migration products_add_price
so that the name is more descriptive of what is actually happening?
(Dave says: yes, that’s a good convention)
2006-06-12
75
OK
In IE6, the default display of the red borders around non-validated controls does not display correctly… the right hand red border is spread right across the page showing up as a big fat red block, instead of just a simple border. The stylesheet shows:
It may be beneficial to show a work around / fix for this, or at least make a comment about it so we don’t feel like we are heading down the line of a non-IE friendly web development platform.
(Dave says: this sounds like a bug in Rails: perhaps it should be reported to the core team)
2006-06-12
81
OK
Downloading depot.css is suggested, but I think it should mention changing the layout to use this new stylesheet rather than the scaffold stylesheet.
(Dave says: that’s on page 84)
2006-06-12
225
TYPO
Section “lib/”: s/fit fit/fit/
2006-06-12
229
TYPO
Second text paragraph: Replace the en-dash (—) with an em-dash (—-) in the fourth line: Gems—-it
(Dave says: good eye!)
2006-06-12
242
TYPO
First paragraph: “… for Rails’ internal use.”
2006-06-12
104
ERROR
Instead of
2006-07-13
0
TYPO
On the ‘Beta Book’ information at the very start of the book, paragraph 4:
In the meantime, we
2006-06-12
226
TYPO
Near bottom of page: "using LighTTP (if it
2006-06-12
81
ERROR
The logo.png image is not on your server to download.
2006-06-12
123
OK
redirect_to_index() in store_controller.rb doesn’t seem to work after each “Add to Cart”. “Add to Cart” does not update the page automatically. However, “Empty Cart” seems to work fine.
(Dave says: it seems to work here. Could you try it with the downloadble code and see what happens?)
2006-07-13
96
OK
The image of the web page with the “Add to Cart” button shows the button adjacent to the item price. However, Rails renders the button with a
around it, so it’s going to appear below the item price (which is how it looks in FireFox 1.5.0.3 on OS X 10.4.6).
(Dave says: this is how it looks in Safari. It may look different in your browser. Got to love standards…)
(Dave says: could you update to the latest Rails and let me know if it is still not working?)
2006-06-13
140
TYPO
Middle of page sentence is missing ‘that’: “Now we have our tables and our models,” should be “Now that we have our tables and our models,”
(Dave says: I leave this kind of thing to Kim, our copy editor..)
2006-06-12
35
OK
Re “Making Development Easier” (auto-reload in development mode):
It doesn’t always work! In particular, it appears that it you have a session open and modify the Cart class code, the edits don’t take effect. This is probably obvious to the experienced, but the tutorial in the book runs straight into this problem.
(Dave says: but, it then shows you how to fix it… :)
2006-06-12
190
TYPO
“it’s built in” should be “its built-in”
2006-06-12
191
TYPO
“if not it adds” should be “if not, it adds” to keep parallel structure with the beginning of the sentence (“If so, …”)
2006-06-12
192
TYPO
“Ruby book’s price” should be “the Ruby book’s price”
2006-06-12
129
OK
When I got to page 141, my code (see p.104) had the “current_item” object called “existing_product”. So it appears you have changed from calling it existing_product to current_item.
(Dave says: that’s right—it changed name because it serves a different purpose now)
2006-06-13
84
TYPO
Near the end of the 2nd paragraph of the sidebar, “They technical term is idempotent…” should be “The technical term is idempotent….”
2006-06-12
49
TYPO
foot-note “We’re tried” -> “We’ve tried”
2006-06-12
169
OK
The delete_user method as-is results in an error:
“undefined local variable or method `user’”
I found that adding a line:
user = User.find(id)
before the “if id && user…” line solved the situaton for me, but I’m uncertain if this is the correct fix for this problem.
(Dave says: my guess is you mistypes the if statment to be "if id && user == User.find)
2006-06-12
103
SUGGEST
Section 8.3 jumps into creating the CartItem class without describing where the class file belongs. (Though its location can be inferred from the link to the download of the file.)
2006-06-12
192
OK
The assertion “test_add_duplicate_product” fails for the price.
the code:
assert_equal 2*rails.price, cart.total_price #failure?
error message:
<20> expected but was <10>
I thought this is may be because the inject method is not invoked properly and changed the assert to verify total items, but this passes the test.
“assert_equal 2, cart.total_items #cart.items[0].quantity”
Any idea what could be the error?
(Dave says: It’m afraid it works fine here. Bring it up under script/console and check cart.total_price. Also, make cure that cart_items.price is correctly defined)
2006-06-12
n/a
SUGGEST
WHY are you using SQL in your migrations for foreign keys? This seems like a very non-RoR thing to do! ;o) How about this instead:
(Dave says: I don’t like the defaults of this plugin, but I do plan to plug it in the new Migrations chapter).
2006-06-12
209
OK
The integration test runs fine, but I couldn’t find the (new) order in the database? Does the test deletes the entries after running them?
(Dave says: all tests do a rollback at the end)
2006-06-12
216
OK
When I run the performance test I get the following error:
NoMethodError: undefined method `stringify_keys!’ for #
Think this is something to do with MySQL, any suggestions?
(Dave says: hmm.. seems to work here. Perhaps try copying the source down from the web site and see if that runs for you)
2006-06-12
92
ERROR
Formatting of the store/index page is incorrect. The dotted bottom border of the
is placed above the price of the item.
Looks like in the depot.css the property float:left is not needed in:
#store .entry .price {
color: #44a;
font-weight: bold;
margin-right: 2em;
/* float: left; */
}
2006-07-13
80
OK
"If you refresh your browser, you should see no dif ference in the page that
2006-06-12
156
TYPO
Is the comment line “# …” in the listing for any particular reason?
2006-06-12
165
TYPO
In the sidebar “A Friendlier Login System”, the change you make using session[:original_url] does not match the above session[:original_uri]
(Dave says: I believe they both say _uri)
2006-06-12
67
SUGGEST
I made the mistake of adding the columns to the 001_create_products.rb file but not saving the file before running “rake db:migrate”. The result was the products table only had an “id” column. Saving the file and re-running “rake db:migrate” didn’t add the columns. I fixed things by running “rake db:migrate VERSION=0”, followed by “rake db:migrate”. Seems like a common enough error that you might want to mention it.
2006-06-12
0
TYPO
Oops just read the page numbering note.
ignore #3813:
1st paragraph, 3rd line
currently -> this content a many
change to -> at this content many
2006-06-12
118
OK
I get a different error from the 2 solved around page 118:
NameError in Store#add_to_cart
uninitialized constant Reloadable
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in `const_missing’
#{RAILS_ROOT}/app/models/cart.rb:11
where do i go to fix these problems?
(Dave says: update your version of Rails)
2006-06-12
148
ERROR
for windows environment, need to specify -u option as follows:
depot>mysql -u root depot_development
Otherwise, the following error will result:
… Access denied for user ‘ODBC’@localhost’ (using password: NO)
2006-06-12
113
SUGGEST
Ph 106 says, "[The client] points out that we
2006-06-12
147
TYPO
In the last paragraph you tell us to clik “Checkout” button, but that should be “Place Order” button right?
2006-06-12
163
OK
On my system, the flash message “User dave created” still hangs around above the Welcome message when I point at http://localhost:3000/login. How can this be removed?
(Dave says: I don’t see that problem)
2006-06-12
116
OK
I think you wanted a space before the “×” in the line in add_to_cart.rhtml: "
<%= cart_item.quantity %>×
"
(Dave says: I’m happy the way it is…)
2006-06-12
133
TYPO
At the top of the page:
"the main page doesn
2006-06-12
24
TYPO
In the section “Locomotive Mac Installation” the last line of the third paragraph states:
Access it from the Rails > Open Terminal menu option.
it should read:
Access it from the Applications > Open Terminal menu option.
2006-06-12
116
OK
The definition of total price invokes a method on CartItem that does not take into account the quantity, it should be changed to:
def total_price
@items.inject(0) { |sum, item| sum += item.total_price }
end
and a total_price method should be added to CartItem:
def total_price
price * quantity
end
(Dave says: have a look at the existing CartItem model…)
2006-06-12
168
TYPO
in the first listing you have
dave[code/depot_q 19:20:09] script/console
which should include the ruby command and for consisency with previous command line examples should read
depot> ruby script/console
2006-06-12
168
TYPO
Since we have already written the delete_user action suggest:
And then write a delete_user action in the login controller.
should be
And then modify/re-write the delete_user action in the login controller.
2006-06-12
169
SUGGEST
Add after the line
session[:user_id] = nil
a line to remove the original_uri in session also, otherwise they don’t always get redirected to login/index to see the orders.
In the models/order.rb code snippet, I had to put the “validates_inclusion_of” line after the definition of the “PAYMENT_TYPES” array, to avoid a run-time error. If that is indeed necessary, there should be a mention in this area.
2006-06-12
127
SUGGEST
Another hint if the Ajax magic doesn’t happen: - Did you remember to delete the add_to_cart.rhtml file?
2006-06-13
26
OK
It is probably a formatting error. Footnote 6 is truncated.
6A newly created Rails application enters the world containing 44 files spread across 36
(Dave says: (it continues on the next page, but we’ll fix that during layout)
2006-06-12
168
SUGGEST
Suggest then that the 006_create_line_items.rb migration be ammended to cater for this situation during forward and backward migrations.
The following will ensure an “admin” user is inserted with a password of “password”
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.column :name, :string
t.column :hashed_password, :string
t.column :salt, :string
(PS: This may be deemed a security issue, so a better solution may be possible, such as allowing navigation to add_user if there are 0 users in the database).
(Dave says: added as an exercise)
2006-07-16
164
OK
After deleting my session information, the first time I navigated to http://localhost:3000/admin/list, I got to the list successfully. After forcing a refresh in my browser (FireFox 1.5.0.4, OS X 10.4.6), I did get to the login page—I think the first time, I got a cached page.
(Dave says: strange—I don;’t see that)
2006-06-12
95
TYPO
In the footnote, ‘layout’ is used as a verb (it’s a noun). Change to ‘lay out’ as in:
…to make them lay out properly.
2006-06-12
74
SUGGEST
Prices are stored as integers, right? So, if a product has a price of $56.43, the admin user would need to type in “5643”, right? Wouldn’t it be easier for the admin to type in “56.43” and have the model convert that into an integer?
(Dave says: yes, but that would muddy the explanation at this point. We’ll cover that in the second part of the book)
2006-06-12
212
TYPO
In the description of the cookies attribute:
“read values form the hash”
should be:
“read values from the hash”
2006-06-12
62
TYPO
“caLlout id” should be “callout id”
2006-06-12
216
TYPO
I’m just learning rails and ruby. Read book one or twice thru. I give it an A-.
Most of my problems when working on my first application involve understanding what gets passed into what automatically. And what I have to send in. In Java, this would be a pure scope issue. But with Rails doing a lot behind the scenes. It would be nice to understand just what information is available say from the controller to the template and from the template to the partial. How things get passed from a template into a partial. Granted I’m new to ruby as well. Some of my challenges have been when to use the @ sign or not. ;-). But the ruby scope is defined fairly clearly in the Pickaxe.
In summary, perhaps a scoping summary table of what’s exposed to what in the framework. And another table of how things get passed into helpers, templates and partials.
Most of the information is spread throughout the book. But not all of it in one easy place. Sometimes in the APIs, but not always consistently (for example, there is no mention of :object hash in the API for partials). If you know of one, let me know.
This knowledge has just about clicked for me (but only with some pain).
(Dave says: Rails has a lot more magic than Ruby, and it doesn’t really have tidy scoping the way RUby does)
2006-07-13
187
TYPO
Third-to-last paragraph: “All of the
testig assertions accept an optional trailing parameter…” (Notice “testig” != “testing”)
2006-06-12
187
TYPO
Once again, third-to-last paragraph: “All of the
testig assertions accept an optional trailing parameter containing a string.
This will we written out along with the error message if the…”
This should be: “…This will [[be]] written out along with the error message if the…”
2006-06-12
1
OK
Second paragraph first sentence. “seem” should be “seemed” because it is past tense.
(Dave says: hmm.. I meant it to be present tense. Let’s see what the copy editor says…)
2006-06-12
173
OK
It will be great to have an example on how to link two different tables associated using a lookup table. e.g. in the diagram 12.1, the arrows point outside.
(Dave says: there is a lot of data modeling stuff that I don’t really have space to document here)
2006-07-25
115
OK
Dont know if this might be intended, but in the source below “private” the find_cart function isn’t visible, mabe add it, or a comment eg. #rest of controller
2006-06-12
31
OK
"We
2006-06-12
18
SUGGEST
Line 3: “… We discuss builder templates starting on page 403.”
This seems disconnected to the rest of the paragraph: ‘Templates’ have been discussed so far, not ‘builder templates’. Either remove the word ‘builder’, explain the difference between ‘templates’ and ‘builder templates’, or explain why the name has changed.
2006-06-12
168
OK
A question I also asked on the forum: why implement things like safe_delete() and delete_user() when there are callbacks like before_destroy() available? The latter could potentially prevent a lot of footshooting in case one forgets to actually use our custom delete_user(). Are there any disadvantages here that I’m missing? I’d like to suggest a throwback to the first edition, where you indeed used before_destroy().
(Dave says: you can’t use before_destroy, because it isn’t transactional. You can do the test in the filter, and then someone else could delete another user, and then your own delete takes place)
2006-10-18
139
SUGGEST
There are code chunks showing how files should look in numerous places, I find it fairly irregular. Sometimes only the new change is listed, sometimes its the change and #rest of model and sometimes its the entire model. I think you should stick to one of these three (preferable “new code” + #rest of model/controller/view).
2006-06-12
84
TYPO
In the sidebar, 2nd paragraph, 4th sentence “…A GET request is defined by HTTP to be used to retrieving data:…”, ‘retrieving’ should be ‘retrieve’.
2006-06-12
81
SUGGEST
says: “…code base would have to do the same. And, if we were working on a team on this project…” which seems just a tad unnatural. I’d suggest “with a team on this project”.
2006-06-12
68
SUGGEST
Modification needed for MySQL4.0.13 for rake db:migrate
I received a rake abort, MySQL error when I tried rake db:migrate. Apparently the Create table statement in MySQL 4 is slightly different than MySQL 5 in that MySQL 5 has ‘ENGINE=InnoDB’ while MySQL4 has ‘type=InnoDB’. Next I tried:
rake db:migrate —trace
And identified the file in activerecord mysql_adapter.rb where I changed from ‘ENGINE=InnoDB’ to ‘TYPE=InnoDB’.
Now the products table is created successfully.
(Dave says: this sounds like a bug in Rails…)
2006-06-12
152
SUGGEST
About the footnote: it might be useful to elaborate why a reader should also take a look at Rails Recipes. Other than a shameless plug, what is the advantage on a technical level?
Dave says: because it shows role-based authentication, too
Roderick says: then that may be worth mentioning, because it now seems to come from nowhere
2006-06-12
130
OK
with add_to_cart.js visual effect only works when the item has already been added to the cart. If being added for the first time I get $(“current_item”) has no properties. I fixed it by surrounding the visual effect expression with an if statement. There is probably a better way to do this I imagine.
(Dave says: I’ve tried it here with both Safari and Firefox, and it seems to work OK. Have you tried using the downloaded code?)
2006-07-13
145
SUGGEST
Sometimes you use line-numbers in the code examples, making it hard to just copy-paste.
EG;
Line 1 def save_order
- cart = find_cart
- order = Order.new(params[:order])
- order.add_line_items_from_cart(cart)
5 if @order.save
- session[:cart] = nil
- redirect_to_index(“Thank you for your order”)
(Dave says: that’s why we have a download link, and why you can download the whole chunk of code from the site. I add line numbers to help folks cross reference)
2006-06-12
133
TYPO
I believe this sentence, "Bruce doesn
2006-06-12
111
SUGGEST
The UnixUtils package referred to in the footer is old and unmaintained. I’d recommend pointing to the GnuWin32 project at: <http://gnuwin32.sourceforge.net/>
Specifically, the CoreUtils package contains the ‘tail’ program: <http://gnuwin32.sourceforge.net/packages/coreutils.htm>
2006-06-12
99
SUGGEST
I’m not sure if this is an error in my understanding. Near the bottom of page 99 when discussing find_cart you say:
“We can achieve that by creating a helper method,”
However, this method then goes on to be put in the store controller.
When i read the line and it said create a helper method, my mind immediately thought back to the previously discussed helper files - so if it is indeed a helper method i was expecting to go and edit a helper file for store. Instead, the method is put in the store controller?!
2006-06-12
89
OK
Is there any reason why you’re using the ERB <% -%> form on this page, when there doesn’t seem to be any potential problem with end of lines? You don’t use this form on page 80 for a similar example…
(Dave says: I didn’t write the code on page 80—the scaffold generator did)
2006-06-12
34
TYPO
Middle of page:
“OK. You Windows users are done: you can skip forward to on page 24. ”
Specify “forward to” what or omit “on”.
2006-06-12
n/a
SUGGEST
The yellow triangle indicators that show changed/added lines in the examples are hard to see in the pdf. Could they be made to stand out a bit more?
2006-06-13
119
SUGGEST
“You can render a partial from another template or from a controller
and the partial will return the results of rendering itself.”
You introduced partials as ‘a kind of method for views’. I really like this analogy, but I think you could perhaps detail the mapping between the two a little more explicitly. For example, you use the verb render, when perhaps it would make sense to initially use the word invoke, and then explain that invoking a partial is the same as rendering it. i.e. you invoke a method, but you render a partial.
Also, a very mild point. The phrase “..and the partial will return the results of rendering itself” is slightly ambiguous. It could mean that the partial itself will return the results of rendering, or that when invoked, a partial will render itself and return the results of that rendering.
2006-06-12
246
SUGGEST
The examples use .at_beginning_of_xxx except for one .beginning_of_quarter and there is no mention of the aliasing (i.e. all the methods are available with and without leading "at". Either mention the aliasing in the text or don’t confuse the reader by using a single method without the leading at.
2006-06-12
142
SUGGEST
“Within this block, you can put normal template stuf f (such as
the
I’m sure that most people will know why the
(Dave says: I changed the text to talk about
insted. I don’t want to divert into an HTML markup discussion here)
2006-06-12
191
SUGGEST
“We’ll simply copy the boilerplate from the product_test.rb file…”. Since product_test.rb has already been significantly modified at this point, wouldn’t it make sense to suggest copying the boilerplate from any of the other unit test files?
2006-06-12
192
TYPO
“…between multiple test cases…” -> “…among multiple test cases…”
2006-06-12
195
SUGGEST
Suggest changing “…these tend be be used infrequently when testing Rails applications, we won’t discuss them here…” to “…these tend be be used infrequently when testing Rails applications—we won’t discuss them here…”
2006-06-12
158
OK
should probably be “user-form” ?
2006-06-12
160
OK
should probably use a different class
(Dave asks: is it not OK as it is?)
2006-06-12
335
SUGGEST
The text on ‘created_at’ doesn’t tell me whether I should define it as a datetime or a timestamp. The docs for ConnectionAdapters::TableDefinition likewise don’t distinguish between these types, except that they both have names.
MySql has both types but Postgresql has only a few varieties of ‘timestamp’ (with and without timezone).
(Dave says: thanks for nudging me—it looks like you can store the timestamo into a date, datetime, or string)
2006-07-25
413
TYPO
"If the image path doesn
2006-10-04
168-169
OK
user.rb :
Which is the difference between “password" (instance variable) and "self.salt", "self.hashed_password"? Why not to use "self.password" or "salt”?
I think it is not clear enough.
(Dave says: @passwrod is an instance variable. self.password is a call to a method)
2006-06-13
65
SUGGEST
“DDL” is mentioned in the second to last paragraph, but no where in the pdf is this acronym defined.
2006-06-12
79
SUGGEST
Why is the model name “product” in lower case on the command line here, but uppercase on page 66?
Would prefer both to be lower case for uniformity, so the reader does not spend time doing research to find that it doesn’t matter.
2006-06-12
157
SUGGEST
This isn’t exactly an error, but on page 15, you generate the Login with several methods. You do not include the method index() among those, yet it is created in the pages that follow, even before delete-users, list_users, or logout are implemented, so it might cause a little less confusion if you included it on the command line.
2006-06-13
81
ERROR
The images repository linked from this page (URL below) doesn’t contain “logo.png” which is needed for the layout introduced on page 91 of the PDF.
Re :null — “If true, the underlying column has a not null constraint added” — s/true/false/.
2006-07-14
261
TYPO
“For example, you might notice that once you application has a large number of
orders in the database…” s/once you/once your/.
2006-07-14
261
TYPO
“Rails takes responsibility for incrementing the value of this column for each new row added toa table.” s/toa/to a/.
2006-07-14
263
ERROR
The example migration to create the books_authors join table contains two errors: create_table :books_authors(:id => false) should not use parenthesis; it should read instead: create_table :books_authors, :id => false. Also, the column definitions are missing a data type (:integer?) before :null => false.
2006-07-14
265
ERROR
AddUsers.down reads “drop_table = :users” but I think should be “drop_table :users”.
2006-07-14
418
OK
It might not be obvious from the Forms Containing Collections side bar
that the select form helper in the following sections can be used in a
similar manner:
assuming that products has a product_type_id and that product_types has
a name column:
stacktrace
yo:$ rake migrate
(in /Volumes/Data/Repository/rst)
Admin: migrating =
— create({:name=>“yo”, :password=>“c41975d1dae1cc69b16ad8892b8c77164e84ca39”})
rake aborted!
undefined method `create’ for #
(See full trace by running task with —trace)
(Dave says: I don’t see this code in the book. However, create automnatically saves the record)
2006-07-14
259
TYPO
In the first sentence under the “Renaming Tables” heading, change “we sometimes fine ourselves” to “we sometimes find ourselves”
2006-07-14
269
TYPO
In the sentence just before the “16.6 When Migra…” heading, change “that authomatically handles” to “that automatically handles”
2006-07-14
251
TYPO
First para second line. Says: “Wouldn’t it me more convenient …”. Should be “Wouldn’t it be more convenient …”. Change me to be.
2006-07-14
258
TYPO
The second last para begins with “If you specify force => true, the migration will …”. I think it should use the symbol :force and not just force. So the correct line should be: “If you specify :force => true, the migration will …”.
2006-07-14
261
TYPO
The para just above the section “Primary Keys” towards the end mentions about “passing an array of colum names to create_index”. There is no other mention of create_index in the book. I think it should be add_index.
2006-07-14
270
TYPO
Last para just before the code which defines run_with_index. The last line begins as “This could be a private method in the model, or or could…”, has the word “or” twice.
2006-07-14
271
TYPO
Third last para, second statement: “To keep track of the schema as it evolves, you can uuse the..”. The word use is miss-spelt as “uuse”.
2006-07-14
439
SUGGEST
I realize the 2nd edition of the Form Helpers section hasn’t been released yet. Having read the 1st edition text, this seems to be a part of the text that I found a good deal less clear than the rest of the book. I would especially like to see addressed editing a many to many relationship with checkboxes, or the case where the join table is actually a model itself. Thanks.
(Dave says: I believe the Recipes book covers this)
2006-10-04
134
SUGGEST
After Ch 9, there is a minor issue with the flash[:notice]. After you enter an invalid item via an explicit url, the flashed message is never removed after new valid items are selected. It continually displays “Invalid product”.
(Dave says: great idea for an exercise)
2006-07-15
n/a
SUGGEST
I don’t recall if it has been suggested before, but I would love if the “Building an Application” section contained, at the end of each task or sub-task, a series of suggested exercises to extend the sample application in small ways to help reinforce the learning process. It’s not always easy when your learning a framework to think of ways to extend examples that fall within the limits of what you have learned.
2006-07-25
218
SUGGEST
Since there are 1000, not 100, products in the performance products fixture, should “…the block creates 100
orders using each of our 100 products…” be changed to something like “…the block creates 100 orders using the first 100 of our 1000 products…”?
2006-07-13
226
OK
“…customs documentation for shipping…” s.b. “…customizes documentation for shipping…”
D (Dave says: customs doc. is required for international shipping)
2006-07-14
226
TYPO
“…to include of PDF receipt writer…” s.b. “…to include the PDF receipt writer…”
2006-07-14
250
TYPO
Last paragraph: One scheme is to keep …
2006-07-14
271
TYPO
Second paragraph: they edit the existing migration
2006-07-14
269
ERROR
"databases just don
2006-07-14
68
OK
You created footnote 3 based on the erratum suggestion #3810, but I hope you might take another look at improving it.
You mention that runing migrate VERSION=0 is only for those feeling “frisky”, but I find that “rake migrate VERSION=0; rake migrate” Is much more convenient than dropping and recreating the database in another tool then rerunning the migration. I usually have a migration along the lines of 001_initial_setup.rb and as I’m specing out the app, I will add columns to it then run migrate VERSION=0 to drop all the existing tables then migrate to get my fresh schema.
(Dave says: I’m glad you experience is good, but othher find VERSION=0 very frustrating, particularly if they have had an error in a migration which leaves the database in an inconsistent state. My experience from teaching Rails is that it’s easier to drop and recreate the database)
2006-06-16
268
TYPO
About halfway down it says ‘foreigh_key()’ instead of ‘foreign_key()’
2006-07-14
138
TYPO
In the last sentence of the footnote “aplugin” should be “a plugin”
2006-07-13
92
ERROR
last paragraph before section 7.3, you mention the depot.css file, but the link is broken.
2006-07-13
159
TYPO
The closing > on all the labels are blue instead of red.
(Dave says: we must get cleverer code formatters… :)
2006-07-13
173
TYPO
The arrow to the line_items table does not have an arrow, but the arrow from it does.
2006-07-13
248
TYPO
“specific” is spelled wrong in “You may have
noticed that the Time class has a similar extension for formatting datetime
fields in a database-sepcific format.”
2006-07-14
243
OK
Where is says “(For strings, it first strips leading and
trailing whitespace before testing.)” many programmers will be left wondering why it strips both leading and trailing whitespace instead of just leading (or trailing) whitespace prior to testing for a string being empty? If there exist non-whitespace characters which can compose a string that is considered “empty”, what are these characters?
(Dave sys: because that’s what the code does… It calls str.strip.empty?, and strip removes leading and trailing whitespace. Agreed, it could be optimized…)
2006-07-14
230
TYPO
Bottom line: “This is less risky that having your project…” should read “less risky than” (p230 on page, p242 in PDF)
Perhaps I have something wrong elsewhere? Right now I’m following along and downloading the pages I haven’t purposely changed anything.
You can email me at pragmatic@dusty.name if you want more info on it.
(Dave says: that’s correct—in the product listing, HTML is escaped)
2006-06-25
All
OK
I find the book’s typeface difficult to read, and suggest you consider changing it to something that appears less “heavy.”
In particular, the letter heights are too similar, so a word like “edit” has the dot of the ‘i’ at the same height as the crossbar on the ‘t’. Even worse is the contraction “it’s” where the dotted ‘i’, crossed ‘t’, and apostrophe are all at the same height.
Also, the letter spacing is too close, so one letter’s serifs might be nearly touching adjacent letters.
Maybe the printed book will be easier to read. But I’m reading it with Adobe Acrobat 6 Reader at 110% magnification on a 17" monitor, and it’s very difficult. Even at 125%, it’s still hard.
Please choose a better typeface. Thanks for listening.
Mike
(Dave says: I’m afraid Bookman is a house style. We actually receive quite a few complements on it…)
2006-06-25
550
SUGGEST
Hi Dave, Can you provide a sample deployment scenario with lighthttpd as well as with Apache? There is lots of discussion on running RoR apps in Apache 1.3 and not in Apache 2.0…so some pointers will be great.
(Dave says: lighttpd deployments seem to be falling out of favor, so the book concentrates on apache/mongrel)
2006-09-26
1
SUGGEST
Having links to the full code is fantastic, except that I’m finding that the code displays VERY poorly. Something that would be very nice is if the code was highlighted, and formatted on a webpage with the ability to comment it. The commenting alone would be near priceless.
(Dave says: the problem is that this code gets refreshed every time the book gets built, and so comments on it might become out of date. I understand what you’re saying, and I’m thinking about how we could work it. In the meantime, I fixed that annoying content-type bug on the site…)
2006-07-28
60
ERROR
The text talks about creating the depot_development database, but does not say to create depot_test and depot_production (even though those entries are present in database.yml). Then the final paragraph says, “…and if you’ve created databases with the suggested names, you can now skip forward….”
There should be instructions to create the test and production databases.
Mike
2006-07-15
184
TYPO
Missing the space after depot> in the second command prompt example.
2006-07-13
93
TYPO
Follow-up to float: left on price — the formatting error is fixed when the “Add to Cart” button is added. The screenshot on this page (figure 7.2) cannot be accurate.
(Dave says: indeed—the stylesheet is the one file shared between all versions of the application, and the float: left was needed when the button is added).
2006-07-13
215
TYPO
“Constructs a url given a set up options.” -> “Constructs a url given a set of options.”
2006-07-13
226
SUGGEST
First full paragraph, "…code that
2006-07-14
83
SUGGEST
Aargh! It took me 10 minutes to discover why the refreshed browser page didn’t have alternating background colors, as stated in the first bullet. It’s not until page 85 do we learn how to use the depot.css file.
It would be helpful to note that the CODE in list.rhtml implements these features, but is incomplete now, and refreshing the browser won’t display everything mentioned.
2006-07-13
999
DEFER
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 code…
For example, in depot_q/app/controllers/login_controller.rb I would expect to see some comments above the class and all def lines. I don’t see any. This would be helpful as it would be a good guide for proper formatting of comments to allow rDoc to work.
(Dave says: This code is included directly into the book, and having a lot of comments would make the text a lot longer. I should, though, produce a fully commented final version at some point)
165
SUGGEST
The sidebar for adding a redirect to the original uri after
login is a welcome addition, but I note that it has one
remaining nit: the login action doesn’t clear session[:original_uri]. I suggest the following modest change to LoginController#login which cleans up the session before the redirect:
# Clear the original_uri before redirect
original_uri = session[:original_uri]
session.delete(:original_uri)
redirect_to(original_uri || { :action => “index” })
2006-07-13
167
SUGGEST
The delete_user action will perform the delete via a GET. It would be to encourage good HTTP method practices and wrap the body of delete_user in a request.post? guard:
def delete_user
if request.post?
user = User.find(params[:id])
user.destroy
end
redirect_to :action => :list_users
end
Of course, this means that users without Javascript enabled
can no longer delete users. On the other hand, if the page
gets scraped for any reason we won’t delete all of the users.
2006-07-13
92
OK
From what I understand, @content_for_layout is deprecated in favor of just plain yield()?
(Dave says: no—Marcel was somewhat overly enthusiastic in that blog post)
2006-06-25
129
OK
DRY.
When adding the id=“current_item” I’d suggest
<tr <%= cart_item == @current_item ? “id=\\”current_item\\“” : “” %>>
in case we later want to add any more attributes to the tr tag.
(Dave says: true—if we ended up doing that, we’d probably want to make the change you suggest. But as we don’t need it now, I prefer the clearer code)
2006-07-13
229
TYPO
“Building Your Application to a Gem Version” callout, second paragraph “When you application starts” s/b “When your application starts”
2006-07-14
261
TYPO
In the first paragraph: “This works as long as your model classes do not contain any addition functionality” s/addition /additional /
2006-07-14
253
TYPO
In paragraph 8: “It then decrements the version, looks for the matching files, undoes it…” The case of “files” and “it” disagree.
2006-07-14
281
SUGGEST
The 17.3 section: “Primary Keys and IDs” section seems redundant with the side-bar on page 262: “Why Use These Artificial Primary Keys?”
2006-08-23
300
OK
Deleting Rows.First Paragraph… "An exception is not thrown if the row doesn
2006-07-14
62
TYPO
Bullet #2 is pointed to twice in the body (by the paragraphs discussing the database and username/password fields). The second instance (discussing the username/password field) should point to bullet #3.
2006-07-15
69
TYPO
The color of the server output is highlighted in Ruby style - the text following a ‘#’ is green.