small medium large xlarge

12 May 2008, 13:42
James West (104 posts)

Hi I have thoroughly enjoyed this book so far - Thank you very much!

I am on my first run through the book and coding as I go but have come across a couple of technical errors that caused me to visit the errata pages and thence found my way here.

Both errors are mentioned in the errata however no solution has yet come to light.

I am so enthusuastic and really want to get this sorted out so was wondering if there would be a solution to these issues before the next release of the book.

Problem 1. From the errata page reported by Dave Isaacs. #31959: After I add the :highlight visual effect, if I click on the Add to Cart button for a book that is not already in the cart, I get the following popup: “RJS error: TypeError: $(“current_item”) has not properties.”

This is followed by a large popup outlining an Element.update() statement followed by a $(“current_item”).visualEffect(…) call.–Dave Isaacs

Problem 2 From the errata pages reported by me :-). #31981: There does not seem to be any method to save a line item.

I assume that the item should be saved if the call is successful but being a total newbie I am not yet clear on the best way of implementing this.

I think this is an area of relational database handling that really needs explanation especially after such an excellent description of how foreign key relationships behave on the previous pages.

This totally superb book gave me the confidence to try to find a solution but I have yet to find one that does not completely lock the database and cause internal server error 500 pages to be displayed after submitting the order.

So could this please be covered in a future revision.

Thanks–James West

Any help in pointing me in the right direction would be greatly appreciated

I fully intend to run through this book coding as I go a couple more times as there is so much to take in and I am sure that I will be able to work these issues out when I have taken it all in but really wanted a solution before I get too much further into the book as I suspect that it will be important.

12 May 2008, 20:39
Sam Ruby (634 posts)

I’m having difficulty reproducing the RJS error, but there was an error in the :highlight visual effect code; it should read “startcolor” and “endcolor” (note: no underscores).

The store controller is missing a line after the


Finally, line_item.rb is missing a line after the assignment to li.total_price:


Sorry about this, and hopefully we will have a beta update out in a few days with these and other errata corrected.

13 May 2008, 08:18
James West (104 posts)

Many thanks.

Just found the solution to the problem with the rjs error

I had an error in my code in cart.rb

current_item = @items << CartItem(product)

Should have been

current_item = @items << current_item

I have no idea why this happened but it seems I am not the only one to have this problem so maybe worth adding a note about this in the next book revision?

Very strange.

I will make the changes you have pointed out to me and many thanks for your response. It really is appreciated.

No need to apologise for the mistakes - I just couldn’t wait for the final release.

I have a MAJOR eBay app that I am wanting to develop and am wanting to do this in Ruby.

Your book has been tremendous in helping me to understand the way Ruby fits together although I still have quite a way to go I am very impressed with the way the book has been able to help me understand how to make the best use of the language in such a short period of time (4 days since I bought the pdf.

So thank you so much once again


You must be logged in to comment