By Developers, For Developers

Historical errata for Rails for PHP Developers

PDF PgPaper PgTypeDescriptionFixed onComments
106TYPO

I currently read the book and found some typos I’d like to share. Mostly added the page and faulty sentence parts first followed by a possible correction.

Page 106: 6.6 Creating New Meetings
.. create an HTML form to submit the the meeting details.
=> .. create an HTML form to submit the (-the) meeting details.

Page 124: .. This technique helps us highlight the the correct navigation …
=> .. This technique helps us highlight the (-the) correct navigation …

Page 132: 7.3 Testing Your Models
Tests are extremely importance (+important?) in our application,

Page 141: Building The Registration Form
This controller will have pretty similar actions those used when …
=> This controller will have pretty similar actions (+to) those used when …

Page 148: If they a user has not been
=> If (-they) a user has not been

Page 154: 8.4 Restoring Sessions
We set a session variable to remember this user when they were created.
=> We set a session variable to remember the user(s?) when they were created.

Page 162: There are some important parts still missing from our application
=> There are some important parts still missing from our application(+.)

Page 168: Adding tests for for our presentation association …
=> Adding tests for (-for) our presentation association …

Page 180: We obviously need need …
=> We obviously need (-need) …

Page 181: Rails logs all thee queries to to
=> Rails logs all thee queries to (-to)
Page 181: If we take a look at this log, we can see that our By tailing this log, we can view the queries that happen on a page.
=> If we take a look at this log, we can see that our (part of the sentence is missing)
Page 182: The culprits here are the find methods from in our meeting model that load up past and upcoming meetings.
=> The culprits here are the find methods (-from) in our meeting model that load up past and upcoming meetings.

Page 186: In this case we’re going to direct it over to the the HomepageController.
=> In this case we’re going to direct it over to the (-the) HomepageController

Page 193: This would just negate all the work we’ve gone to hiding these links for from them.
=> This would just negate all the work we’ve gone (+for) to hiding these links (-for) from them.

Page 200: Joe is super grateful for our help with application
=> Joe is super grateful for our help with (+the) application

Page 217: Converting to an Array
… to an array in Ruby is done done by enclosing any object …
=> … to an array in Ruby is done (-done) by enclosing any object …

Page 223: Nil in Ruby is a little more interesting because it is actually an object just like everything else; Just an object that represents no value.
=> … like everything else; (j??)ust an object that represents no value.

Page 234: Switch statements in Ruby evaluate and return a value as well.
=> Code for switch statement is repetition of if statement code

Page 243: If we truly wanted to check object type, Ruby objects all have an is_a? …
=> If we truly wanted to check (+an|the) object type, Ruby objects all have an is_a? …

Page 269: Autoloading Objects
There is not magic method in Ruby that is the equivalent of …
=> There is no(-t) magic method in Ruby that is the equivalent of …

Page 274: Ruby class methods will are the closes we get to PHP’s static methods…
=> Sounds weird, maybe: Ruby class methods (-will) are the closes(+t) (+way|construct) we get to PHP’s static methods…

Page 283: In these examples, we have a collection of errors that are added and stored in nested data structure.
=> In these examples, we have a collection of errors that are added and stored in (+a?) nested data structure.

Page 291: Ruby will will continue execution as long as the object responds to the messages thrown at it.
=> Ruby will (-will) continue execution as long as the object responds to the messages thrown at it.

Page 300: … available when working in a action or view.
=> … available when working in a(+n) action or view.

2008-01-07
389ERROR

The code examples on that page are reversed.

2008-01-07
1SUGGEST

There should be some information about CRUD in rails. Now that topic isn’t even mentioned.

2008-01-07
19TYPO

Under ActionMailer, it should say “This part will”

2008-01-07
52TYPO

just before 2.6, remove duplicated word from “opposite opposite”

2008-01-07
59TYPO

second paragraph under 2.8, “take a look AT some”

2008-01-07
62TYPO

In second paragraph, this should not be a period (colon perhaps?) in the passage “explicitly checked. Once in the”

2008-01-07
81TYPO

{add this} [delete this]

First paragraph: “In Ruby this means that we are using objects, {and?} we are only concerned about what {they can?} do, and not the actual type of the object.”

Second paragraph: “Since PHP is a dynamic language[, and] we are usually not concerned about the specific type of data being passed around.”

2008-01-07
84TYPO

{add to} [delete from]
First paragraph: “It’s important to have the ability {to} examine behavior, and Ruby makes it easy to do so.”

2008-01-07
55TYPO

First sentence:
Positional parameters don’t can’t help us…

Second to last paragraph:
We’ve to managed make the code…

2008-01-07
67TYPO

Second paragraph:
…you should recognize that 99 is an object that {it} has a method called…

Fourth paragraph:
A block is {a} function…

2008-01-07
71TYPO

First bullet point has reversed words:
We learned how {the useful} Interactive…

2008-01-07
75TYPO

First paragraph:
…a subtle difference in how we{’ve} assign and access…

and

…it makes perfect sense when assigning data to {an} attributes of our object.

2008-01-07
76TYPO

First paragraph:
The $title attribute is protected, and we added a{n} getter method…

Last paragraph:
…to our PHP, and has a{n} getter method.

2008-01-07
82TYPO

Last paragraph missing word:

This once again begins to reach limitations if {we} wanted to pass…

2008-01-07
86TYPO

Second paragraph:
Modules are very similar {to} classes.

2008-01-07
91TYPO

3.7
Ruby uses a special syntax {to} make these methods…

2008-01-07
94TYPO

Last sentence:
Now we can use {our} new method…

2008-01-07
102TYPO

First paragraph:
That workflow starts by making us {examine}[examining] our problem domain

Second paragraph:
…we see that each meeting {is} needs an…

2008-01-07
103TYPO

Third paragraph missing word:
More information {about} finding and installing…

2008-01-07
119TYPO

4.7 Chapter Review (words out of order)
You made it through and {laid a} foundation…

2008-01-07
127TYPO

First paragraph:
…and would still break any outside link{ed} that pointed…

2008-01-07
136TYPO

First paragraph:
This time we’ll {to} take a look at…

2008-01-07
144SUGGEST

5.8 first example:
It may be helpful to give a better explanation as to why you’re using ‘redirect_to’ in the if, and ‘render’ in the else.

2008-01-07
152TYPO

Missing word
Destroying Meetings:
This action [is] simple, and once again instantiates…

2008-01-07
153SUGGEST

It seems you may want to at least mention :only since you’re discussing :except

2008-01-07
160TYPO

5.13
Third bullet:
Try{ing} using the new…

2008-01-07
164TYPO

First paragraph:
ActiveRecord objects have a method named errors which is [a] list of errors…

2008-01-07
165TYPO

6.2 third paragraph:
It the{m}[n] loads a configuration file…

2008-01-07
165TYPO

6.2 last paragraph:
…hit refresh on your browser and see the changes immediate[ly]

2008-01-07
166TYPO

6.3 first paragraph:
Tests are extremely {importance} [important] in our application

2008-01-07
171TYPO

Second paragraph:
Let’s take a look at the tests that we come up [with]?.

2008-01-07
150SUGGEST

It would be worth mentioning the purpose of the minus sign (-%>) at the end of the error_messages_for tag. I initially thought it a typo.

2008-01-07
175TYPO

last paragraph:
We’ll use this same migration file to rename the {our} password column…

2008-01-07
181TYPO

Adding the Password Attribute:
We’ll do [this] using the…

2008-01-07
189TYPO

Second Paragraph:
This method generates an img tag using the image name [and] a hash of options.

2008-01-07
195TYPO

Third paragraph:
…the idea of defining custom helpers {by} within the modules…

2008-01-07
195TYPO

Third paragraph:
We can pass it [a] list of method names…

2008-01-07
197TYPO

Last paragraph:
…and needs to use a[n] email and password field.

2008-01-07
204TYPO

The belongs_to methods here declare[s] that a presentation object

2008-01-07
207TYPO

Fourth paragraph repeat ‘for’:
Adding tests for {for} our presentation association

2008-01-07
208TYPO

8.3 second paragraph:
Now that we [have] the associations set up,

2008-01-07
212TYPO

First full paragraph:
Since we’ve {been} passed in the meeting_id to all methods,

2008-01-07
217TYPO

First sentence missing word:
If [you] take a look back at our index view again,

2008-01-07
217TYPO

First sentence extra word:
If take a look back at our index view again, we’ll see that {the} we’ve refactored this by replacing our meeting lists with partials.

2008-01-07
221TYPO

Second to last paragraph. Poorly worded sentence:
Rails will perform an outer join to retrieve all the
data needed, and sort the data out build the separate objects.

2008-01-07
222TYPO

8.7 second bullet:
We learned a little about how test driven development works, and how it can give us a{n} immediate feedback cycle without a browser.

2008-01-07
229TYPO

First paragraph. Extra and missing word.
This method simply redirects to the login page {when} if [a] user is not an administrator.

2008-01-07
233TYPO

First paragraph. Entire sentence needs some attention.

This would negate all the work we’ve gone to hiding these links for from them.

2008-01-07
274TYPO

First paragraph:
…but are convenient in {a} some situations.

2008-01-07
278TYPO

Associative Arrays and Hashes
The most important difference to remember is that hashes in Ruby are {an} unordered collections.

2008-01-07
286TYPO

Instance Variables
Instance variables are {discusses} [discussed] in depth in Sections 12.3…

2008-01-07
295ERROR

11.5
Second set of examples are identical to first pair.

2008-01-07
294TYPO

11.5 Expressions
An expression{s} in Ruby works pretty similar…

2008-01-07
241TYPO

If you want to play around more with this application, there {is} [are] plenty more places it can be taken.

2008-01-07
21TYPO

“You’re first instinct” should be “Your first instinct”.

2008-01-07
61TYPO

PHP Exceptions - paragraph 3
“PDO is that standard data access library”
should be
“PDO is the standard data access library”

2008-01-07
68TYPO

Paragraph 3
The second sentence of this paragraph seems incomplete. Something confusing about “and now looking at”.

2008-01-07
86TYPO

Extra “s” at end of paragraph 2 -
“is that a module[s] cannot be instantiated.”

2008-01-07
91TYPO

Missing “s” at beginning of paragraph 1.
“The Document object no longer need{s} to be”

2008-01-07
274TYPO

Retrieving elements
Confusing punctuation etc. Could be this?

“Accessing elements of an array is nearly identical[ly] in Ruby[,] and PHP{,} and is done by specifying a numeric index in square brackets.”

2008-01-07
52ERROR

In the PHP code, the comments displaying the arrays values should be switched.
$a contains the associative array, not $b.

25SUGGEST

May be already addressed, but I suggest recommending an install of Rails 2.0.2 instead of 2.0 RC2 aka v1.99.1, if it’s not too late. (And thank you for writing this book with 2.0 in mind regardless…)

68TYPO

Double ‘the’ in the second paragraph. “The ampersand (&block) tells Ruby to store this object in the the variable called block.”

111TYPO

Missing:
‘updated_at‘ datetime default NULL,

in the SQL-code.

138TYPO

Last line should read ““No Meetings” as the tag content" instead of ““New Meeting” as the tag content"

156ERROR

Links for stylesheet and images in the footer is inaccessible (forbidden).

175SUGGEST

Maybe explain the AddColumnsToTable / RemoveColumnsFromTable convension?

179ERROR

“We’ll have to manually add the create method since it does not require a view”

- And update and destroy too

184ERROR

From the console commands: user = User.find(1)

This will not work as there is no user in the db yet.

69TYPO

“enough buzz about Rails to finally peak his interest” should be “enough buzz about Rails to finally pique his interest.”

“Peak” => noun; top of something
“Pique” =>verb; to stimulate

Page number may be inaccurate; I’m reading the sample excerpt.

80TYPO

in the second paragraph the word “contining” should be “containing” shouldn’t it?

82TYPO

in the second paragraph
…Since both ducks and {shouldn’t that be goose?} are part of the Anatidae family…

99TYPO

In the feature list nr. 4
… list members with a {brief NOT breif} description

28SUGGEST

Would be nice to mention rake db:create instead of of the DB-dependant mysqladmin.

33TYPO

Second to last paragraph: “In this case, the functionality of our Newsletter class (…)”

Should be “… of our Subscriber class…”, no?

38TYPO

Last paragraph: “We’ve also used a helper method named form_for (…)”

It’s form_tag.

21TYPO

Last sentence in 2nd last para. “We’ll use an method” should be "We’ll use a method. Not a big deal, admittedly, but see also omission on same page.

21SUGGEST

The code for the class at the bottom of the page could be mistakenly entered into the already open model file. Suggest inclusion of a line of text such as “Let’s open the subscribers_controller.rb file”. The tiny font in the shaded heading is easy to miss.

10-11SUGGEST

A “work>” prompt appears on page 10, but the cd work command doesn’t appear until page 11

13SUGGEST

The shaded folder is shown as getting_started_with_rails/newsletter_1/config/database.yml. Shouldn’t this be work/newsletter/config/database.yml? On later pages, the shaded folder displays newsletter_2 and newsletter_3. Why?

123TYPO

In Fig. 5.2 in the “View Naming Conventions” box

File: app/views/new.html.erb
should be
File: app/views/users/new.html.erb

123TYPO

Is: reoccurring
Should be: recurring
In: “…these seven actions tend to show up as a reoccurring
patter n in applications.”

95TYPO

In 3.10 Exercises second line “We already reopened Fixnum to add the odd?” should be “We already reopened Integer to add the odd?”

308ERROR

I’m new to rails, and just bought the books, but I think this may be wrong:


page = 1
begin
puts page
page += 1
end while < 10
———————————

The last line should be:

end while page < 10

?

231ERROR

The code example’s first line at the bottom of page 231 (PDF) looks like this:

<% elsif user_owns_record? %>

I guess it should be “elseif” instead.

152ERROR

When I add the line
validates_presence_of: meets_on
to my meeting class and I view the the localhost:3000/meetings page, I get the following error:

/meeting.rb.2 syntax error: unexpected ‘:’ expecting kEND
validates_presence)of:^meets_on

When I remove the space between the colon and meets_on, the page loads with out errors

Gerard

52TYPO

“It was shows”

231223ERROR

David Trasbo’s reported error on page 231 of the PDF (223 of the paper version I’m looking at) is wrong. ‘elsif’ is the proper spelling in Ruby (and also in Perl—Larry Wall didn’t like the resulting dipthong either). PHP uses ‘elseif’.

If this is still shown and a reader is looking at this errata page they might be misled into thinking that ‘elseif’ is correct for Ruby, and it ain’t so.

115ERROR

In the figure at the top of the page (F 5.4: The meetings index page) the screen cap shows the file URI as

app/views/meetings/index.rhtml

However, as the book is supporting 2.0, the URI should be:

app/view/meetings/index.html.erb

152SUGGEST

I had the same error as another reader - was because on the validates_length_of I had missed the : off the :minimum - the book was correct.

81TYPO

‘can be a strictly type language’ should read ‘can be a strictly typed language’

129TYPO

‘Lucky for us’ should be ‘Luckily for us’ since the errors luckily display only in the development environment.

250TYPO

The required Apache module should read “mod_proxy-http,” not “-html.”

110ERROR

the source code for the self.down() method is missing.

123TYPO

in the second box of fig. 5.2, the views url should be /app/views/users/new.html.erb

130ERROR

If the “()” are left on the CURRENT_TIMESTAMP, ie CURRENT_TIMESTAMP() then rails errors, remove them and it works. Lines 4 and 9 in the code block.

167ERROR

shouldn’t it be
ruby -I test test/unit/meeting_test.rb
rather than ruby test/unit/meeting_test.rb
?

144TYPO

In the third paragraph, “public/stylesheeets” should be “public/stylesheets”

161ERROR

When running the test suite at the end, I get “6 tests, 10 assertions”, not the “6 tests, 9 assertions” shown in the book. The correct could seems to be 10, as there are two asserts in test_should_create_meeting

161ERROR

(Great, I’m submitting an erratum for my own report, since I can’t edit it.) In #36711 “correct could” should be “correct count”. [Filed as technical so it is categorized with the erratum it is correcting.]

40TYPO

“will be automatically be checked”

One too many “be”

63TYPO

The second to last line seems to be missing an “it”:
“…price as if were a public attribute." should probably be "...price as if it were a public attribute.”

1ERROR

It is appalling that the page numbers for errata are keyed only to PDFs, and are completely different from the version held by paying customers of your printed book. Thanks so much. This will definitely get a mention in my Amazon review.

96ERROR

self.up in db/migrate/001_create_users.rb has the line

t.text :profile, :text

This creates a spurious field “text”. It should be

t.text :profile

156SUGGEST

This applies to Chapter 6. The version of Rails I am using as of April 2009 (Rails 2.3.2) uses ActiveSupport::TestCase instead of Test::Unit::TestCase. This only changes the signatures of the test methods; otherwise the examples work as programmed. I had to change the generated require line to match the one in the book before my tests would work.

98TYPO

[Figure 4.1; row 4]
The word “brief” is misspelled as “breif”

P.S. The book is great! I love it

159ERROR

I’m looking at the unit test called “test_should_format_date_as_name”.

The regular expression /\\w* \\d{1,2}, \\d{1,4}/i is in error.

The text ‘March 6, 2010’ will pass that test, even though there are two spaces between March and 6. The reason is that \\w* is zero or more word characters, so the leading “March ” is being ignored.

The expression is better written:
/^\\w+ [ \\d]\\d, \\d{4}$/

tennysonbltennysonblSUGGEST

due forcings routes

ricestedmricestedmSUGGEST

variations cost thermal warms

38TYPO

form_for should be form_tag

Categories: