By Developers, For Developers

Historical errata for Rails for .NET Developers

PDF PgPaper PgTypeDescriptionFixed onComments
23ERROR

In the example on page 23 , the generate script is demonstrated.

In the figure, the command text gets wrapped to the next line and the part of the command that gets wrapped has a blue typeface that does not match the red, bold typeface that the first part of the command had.

35TYPO

On PDF page 35 under section 2.3, the following ruby code is sampled:

puts “\\t#{5*10}”

and the result in the book is said to be

500

when the true result is (clearly)

50

39TYPO

On PDF page 39 on line 1 of the .NET code example a string of characters is present that is not .NET code:

#

34SUGGEST

The wording in the last paragraph of the to_s vs. ToString() section on page 34 implies that the an example of to_s was shown to the reader.

36TYPO

On page 36 the line puts flight.sub(/(w+)\\bto/, ‘PDX to’) doesn’t produce the listed output.

36TYPO

The first line of output in the flight example is actually the first line of code – flight = “United Airlines, Flight #312, ORD to LAX, 9:45AM to 11:45AM”

36ERROR

There are also some code color issues with the output of the flight example.

52TYPO

“A static method called Models() returns a list of available models that can be used.” Models is a property.

53TYPO

“In the body of the initializer, we have defined two instance variables, model and altitude.” There are 3 instance variables defined.

62TYPO

There’s 2 methods nested inside of a method for the C# 2.0 example.

62SUGGEST

Small issue with the LINQ version – if you want to keep the examples functionally equivalent then AddDays(–8) is incorrect.

94TYPO

The text/symbol “>” appears twice in the example of the generate script:

c:\\dev\\flight> ruby script\\generate model flight

c:\\dev\\flight> ruby script\\generate controller flights

97TYPO

The text/symbol “>” appears twice on this page in the example of the scaffold generate:

c:\\dev\\> rails flight

c:\\dev\\flight\\> ruby script\\generate scaffold flight

108TYPO

Missing a space in passengersArray - should read "passengers Array"

28TYPO

After adding the new column with rake db:migrate, the text says to add the new field to the existing view pages. It says to “Open app/views/new.html.erb” which doesn’t exist. It should say “Open app/views/books/new.html.erb”

29SUGGEST

It seems like the code example should include the changes that are being talked about in the text. Adding the code for the new field:

Purchased on

<%= f.date_select :purchased_on %>

115TYPO

Unexplained #END HIGHLIGHT comment. I’m guessing the arrows are supposed to stop at that line because the code after #END HIGHLIGHT didn’t change.

117TYPO

#BEGIN HIGHLIGHT comment. Guessing that the code is supposed to be highlighted with arrows.

131SUGGEST

The proposed show action potentially hits the database twice. Not a big deal if you’re consistently using the named route, but I’d probably use the ternary operator to determine whether or not we have a name parameter.

165TYPO

Few things on this page:

“header and footer to our views” - there isn’t really a footer being added. There’s a header and you’re styling the content.

It’s also unclear if the flights_enhanced layout’s header’s id is set correctly. If it is set correctly I think you should add styling for this element in scaffold.css. This would make your intentions clearer (the reader would have a visual confirmation).

There’s a lot of issues with the downloadable code in this section. Layouts render as html in my browser and a lot of it contains markup (<# START_HIGHLIGHT>, <# END_HIGHLIGHT>, etc).

29TYPO

The sentence on PDF p29 “Using the same technique, you should also go ahead and enhance app/views/NEW.html.erb in the same way.” should presumably reference app/view/EDIT.html/erb instead.

23TYPO

The ruby command is two lines but is not highlighted on the second line. This was very misleading, and caused me to have to go back and painfully correct my mistake.

29TYPO

The source listing for new.html.erb does not include the purchased_on field.

34SUGGEST

The comment about to_s appears before the code it refers to; perhaps it should be moved?

35TYPO

5 x 10 should be printed out as 50, not 500 as shown in the code listing.

36TYPO

The standard class for working with regular expressions in .NET is Regex, not RegExp.

36TYPO

The second output listing on the page should not include the first line. It is a repeat of the variable assignment, and wouldn’t be displayed.

36TYPO

The second output listing should not have the output colored green, as if each line contained a comment.

39TYPO

The List<> type is a collection, not an array. Either the text needs to be updated to note the distinction, or an actual array should be used in the C# code examples.

94TYPO

The command prompts have the > character escaped in the code listing but shouldn’t.

130TYPO

Shouldn’t the text “/flights-for-today/” map to the AirlinesController, not the FlightsController?

160TYPO

Shouldn’t the airports variable be prefixed with the @ symbol, since it’s a member of the generated view?

165TYPO

Either the id of the h1 element or the CSS needs to change, since they don’t have the same value (flights vs header) in the code listings.

36TYPO

puts flight.sub(/(w+)\\bto/, ‘PDX to’) # is a pattern match and should use the gsub method NOT the sub method

36TYPO

puts flight.sub(/(w)\\bto/, ’PDX to’) # the regular expression is incorrect; maybe: gsub(/\\w \\bto/, ‘PDX to’)

238TYPO

Context:
————————
Using a third-party gem from within your Rails code is dirt simple. Rails
knows to activate the RubyGems environment when it starts up, so all
you have to do is tell Rails which Rails your application depends upon.
You’ll then need to decide whether you want to bundle a copy of each

Description:
——————
the second line (bottom to top) of the las paragraph should say: “so all
you have to do is tell Rails which Gem” instead of “so all
you have to do is tell Rails which Rails”

45TYPO

“A symbol is globally unique, named representation of” should be “A symbol is a globally unique, named representation of”

118ERROR

Missing from code listing:

<%= will_paginate @passengers %>

But available in referenced download

124TYPO

“This additional line of code with result in a standard error message displayed inline,” should read “This additional line of code will result in a standard error message displayed inline,”

50TYPO

In the second paragraph of 3.1 Working with Collections and Iterators you state “…we may way want to synthesize an entirely new data set containing only those elements that meet certain criteria.” The word “way” shouldn’t be there.

Categories: