Errata


Print Print Icon

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



Version Location Description Submitted By
Safari Books Online 2.2
1st code sample

I called it serious, because the code just won't work in Rails 2.0

You need to add the form's authenticity token to the params before Rails 2.0 will accept it:

authenticity_token=<%= form_authenticity_token %>

I simply added this string after a "?" after 'myresponse' in line 6 of the sample code.

Anonymous 
Safari Books Online 2.2
First code block

In the first code block, the current version of rails enforces security with an authentication token. The default call produced here is a post which triggers an InvalidAuthenticityToken error.

<p><a href="#" onclick="prototypeAlert( );">Call with Prototype</a></p>
<script type="text/javascript">
function prototypeAlert( ) {
new Ajax.Request('/chapter2/myresponse', { onSuccess: function(request) {
alert(request.responseText);
}})
}
</script>

It is easily fixed by adding "method: 'get'," to the new Ajax.Request call, like this:

<p><a href="#" onclick="prototypeAlert( );">Call with Prototype</a></p>
<script type="text/javascript">
function prototypeAlert( ) {
new Ajax.Request('/chapter2/myresponse', { method: 'get', onSuccess: function(request) {
alert(request.responseText);
}})
}
</script>

Wayne Andersen 
Printed Page 34, 37
First example source on the page

The code only renders the time and one doesn't get a chance to click on a link. Thus, it seems to be an issue in the controller action on page 34:

def get_time

# This line generates an error message.
sleep 1.second

# This line just renders the text within the view time text in the
# without displaying the link.
render :text => Time.now

end

Thus, the code on page 37 fails to execute successfully.

Anonymous 


"...this is the definitive text on the topic."
--Brian DeLacey