Learning Rails 3

Errata for Learning Rails 3

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date Submitted
Printed Page 31
Figure 3-4

Screenshot doesn't match code. It says (using layout) is should say (using hello layout)

Casey Borders  Jul 27, 2012 
PDF Page 107
1st par

hi there, in rails 3, and rails 4, validates_presence_of :name is rewritten with: validates, :name, :presence=>true

Claudiu  Jul 26, 2012 
PDF, Mobi Page 132
4th code block

In the label_for method, defined as: def label_for(method, options={}) label(options.delete(:label) || method).safe_concat("<br />") end If a :label is defined, the label's for property will be formed using the :label value rather than the method. For example, using the call <%= text_field :name, :label => "Your name" %> produces the following HTML: <div class='field required'><label for="person_Your name">Your name</label><br /><input id="person_name" name="person[name]" required="required" size="30" type="text" /></div> In the above, the for property is "person_Your name" instead of the field's id, "person_name" Changing to: def label_for(method, options={}) label(method, options.delete(:label) || nil).safe_concat("<br />") end corrects the error, yeilding the following HTML: <div class='field required'><label for="person_name">Your name</label><br /><input id="person_name" name="person[name]" required="required" size="30" type="text" /></div>

Anonymous  Aug 08, 2013 
Printed Page 150
from heading "Changing the Controller"

Text states "Example 9-1 shows the new controller, with all changes bolded..." but nothing is boldfaced in the example. The lack of boldfacing/highlighting in examples that are supposed to have changes highlighted seems to be a recurring issue in the print edition, this is but one location of many.

Anonymous  Apr 21, 2014 
Printed Page 151
United States

In the "new" method, the first line (@student = ...) is not needed.

Mike Spalinger  Oct 08, 2012 
ePub Page 3247
Example 9-1

Noe of the changed code is highlighted in bold (author refers to changed code being bold). This is a problem throughout the Kindle version of this book, this is only one example.

Anonymous  Aug 29, 2013