# Agile web Development with Rails section 9.3

**URL:** <https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873>\
**Category:** Ruby\
**Created:** [May 19, 2010, 7:02pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873 "2010-05-19T19:02:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![angel-il6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@angel-il6](https://www.ruby-forum.com/u/angel-il6)\
**Post date:** [May 19, 2010, 7:02pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873/1 "2010-05-19T19:02:17Z")

</div>

Hello  
I am reading Agile Web D. with rails (third addition).  
And I need some help with it.  
I have reached chapter 9.3

when I press on the add to cart button I get an error message.  
a real ugly one.

eventually, I downloaded the PDF version and copied the content of the  
files but it did not help.

I have looked but could not find the problem.  
Please give me a hand.  
Thanks  
Angel

try {  
Element.update(“cart”, "\n\n\<div class=“cart-title”\>Your  
Cart\n

\n \n\n\n\n\n \<tr  
id=“current\_item”\> \n\n\n\n\n\n\n\n \n \n $209.65\n\n\n\n \n \n $209.65\n \n\n

| 7× | Pragmatic Project Automation |
| Total |

\n\n

\n"); $("current\_item").visualEffect("highlight", {"endcolor":"#114411","startcolor":"#88ff88"}); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"cart\", \"\\n\\nYour Cart\\n\\n \\n\\n\\n\\n\\n \\n\\n\\n\\n\\n\\n\\n\\n \\n \\n $209.65\\n\\n\\n\\n \\n \\n \\n \\n\\n

|
| |
| 7× | Pragmatic Project Automation |
| Total | $209.65 |

\\n\\n

\\n\");\n$(\"current\_item\").visualEffect(\"highlight\", {\"endcolor\":\"#114411\",\"startcolor\":\"#88ff88\"});'); throw e }

---

<div class="post-metadata">

**Author:** ![angel-il6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@angel-il6](https://www.ruby-forum.com/u/angel-il6)\
**Post date:** [May 19, 2010, 8:36pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873/2 "2010-05-19T20:36:28Z")

</div>

On Wed, May 19, 2010 at 12:02 PM, Angel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## id="current\_item"\> \n\n\n\n\n\n\n\n {“endcolor”:“#114411”,“startcolor”:“#88ff88”}); action=\"/store/empty\_cart\" class=\"button-to\"\> \<input type=\"submit\" value=\"Empty cart\" /\>\<input name=\"authenticity\_token\" type=\"hidden\" value=\"6ZdrTVjPgu0Lls4YyuTXbg1an5X/KKNZJKgDfruU6Qo=\" /\> \n");\n$("current\_item").visualEffect("highlight", {"endcolor":"#114411","startcolor":"#88ff88"});'); throw e }
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Hi, this is a Ruby mailing list (the language Rails was written in), not  
a  
Rails mailing list. You should try a Rails list, you will get much  
better  
help. Especially considering the code you posted looks like JavaScript,  
not  
Ruby.

A few things, though:

1. If you are certain you’ve done everything correctly, you might check  
the  
errata to see if something in the book isn’t right:  
[Pragmatic Bookshelf: By Developers, For Developers](http://www.pragprog.com/titles/rails3/errata)

2. You said “when I press on the add to cart button I get an error  
message.  
a real ugly one.” but you haven’t given any information about the error  
message. These exist to let you know something is wrong, and where it  
went  
wrong so that you know where to go start troubleshooting. This would be  
good  
information to include, it gives people (and you) an idea where it went  
wrong.

---

<div class="post-metadata">

**Author:** ![angel-il6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@angel-il6](https://www.ruby-forum.com/u/angel-il6)\
**Post date:** [May 19, 2010, 9:09pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873/3 "2010-05-19T21:09:13Z")

</div>

Thank you for replying.

the application is written in Ruby.  
the error message is something I do not understand.  
the link to my files is at:

Download link: [http://rapidshare.com/files/389266124/chapter-9.tar.gz](http://rapidshare.com/files/389266124/chapter-9.tar.gz)

[http://localhost:3000/store](http://localhost:3000/store)

I am certain that I did something wrong, I just can’t seem to find  
what…  
the ugly message I got is the code I attached in my first message.

Thanks for your help

Josh C. wrote:

> On Wed, May 19, 2010 at 12:02 PM, Angel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > ## id="current\_item"\> \n\n\n\n\n\n\n\n {“endcolor”:“#114411”,“startcolor”:“#88ff88”}); action=\"/store/empty\_cart\" class=\"button-to\"\> \<input type=\"submit\" value=\"Empty cart\" /\>\<input name=\"authenticity\_token\" type=\"hidden\" value=\"6ZdrTVjPgu0Lls4YyuTXbg1an5X/KKNZJKgDfruU6Qo=\" /\> \n");\n$("current\_item").visualEffect("highlight", {"endcolor":"#114411","startcolor":"#88ff88"});'); throw e }
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> Hi, this is a Ruby mailing list (the language Rails was written in), not  
> a  
> Rails mailing list. You should try a Rails list, you will get much  
> better  
> help. Especially considering the code you posted looks like JavaScript,  
> not  
> Ruby.
> 
> A few things, though:
> 
> 1. If you are certain you’ve done everything correctly, you might check  
> the  
> errata to see if something in the book isn’t right:  
> [Pragmatic Bookshelf: By Developers, For Developers](http://www.pragprog.com/titles/rails3/errata)
> 
> 2. You said “when I press on the add to cart button I get an error  
> message.  
> a real ugly one.” but you haven’t given any information about the error  
> message. These exist to let you know something is wrong, and where it  
> went  
> wrong so that you know where to go start troubleshooting. This would be  
> good  
> information to include, it gives people (and you) an idea where it went  
> wrong.

---

<div class="post-metadata">

**Author:** ![angel-il6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@angel-il6](https://www.ruby-forum.com/u/angel-il6)\
**Post date:** [May 19, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873/4 "2010-05-19T21:39:19Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![angel-il6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@angel-il6](https://www.ruby-forum.com/u/angel-il6)\
**Post date:** [May 19, 2010, 9:20pm UTC](https://www.ruby-forum.com/t/agile-web-development-with-rails-section-9-3/188873/5 "2010-05-19T21:20:23Z")

</div>

On Wed, May 19, 2010 at 1:09 PM, Angel D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you for replying.
> 
> the application is written in Ruby.

Regardless of the application being written in Ruby, Rails is a huge  
and separate project from Ruby and thus requires its own mail list.  
It looks like you are using ruby-forum to access the mailing list, so  
just look a single link down on the main forum list. Here, I’ll even  
give you a direct link there… [http://www.ruby-forum.com/forum/3](http://www.ruby-forum.com/forum/3)

> the error message is something I do not understand.

Yes, but without the error message no one is going to be able to help  
you.

> [http://localhost:3000/store](http://localhost:3000/store)

Localhost is local, only you can access it.

-Jonathan N.
