Topic: Ajax problem with depot application

Hello,

I'm fairly new to Rails and I'm following along with the depot application in the Agile Development with Rails book.  I've gotten to the part where I've added the ajax for the cart, so that it uses ajax to update the cart fragment on the sidebar, however when I try to add an item to my cart I get sent to a url that looks like:

http://localhost:3000/store/add_to_cart/3

And the main body of the page gets updated with the correct Javascript to update the cart div tag, however the update just displays in the browser window it isn't actually executed.  So when I click add to cart I get a screen with the following:

try {
$("cart").update("<div class=\"cart\">Your Cart</div>\n\n<table>\n    <tr>\n    <td>4 &times;</td>\n    <td>Pragmatic Project Automation</td>\n    <td class=\"item-price\">$119.80</td>\n</tr>\n    <tr class=\"total-line\">\n        <td colspan=\"2\">Total</td>\n        <td class=\"total-cell\">$119.80</td>\n    </tr>\n</table>\n    \n<form method=\"post\" action=\"/store/empty_cart\" class=\"button-to\"><div><input type=\"submit\" value=\"Empty Cart\" /></div></form>");
} catch (e) { alert('RJS error:\n\n' + e.toString()); alert('$(\"cart\").update(\"<div class=\\"cart\\">Your Cart</div>\n\n<table>\n    <tr>\n    <td>4 &times;</td>\n    <td>Pragmatic Project Automation</td>\n    <td class=\\"item-price\\">$119.80</td>\n</tr>\n    <tr class=\\"total-line\\">\n        <td colspan=\\"2\\">Total</td>\n        <td class=\\"total-cell\\">$119.80</td>\n    </tr>\n</table>\n    \n<form method=\\"post\\" action=\\"/store/empty_cart\\" class=\\"button-to\\"><div><input type=\\"submit\\" value=\\"Empty Cart\\" /></div></form>\");'); throw e }

This is the behavior in Firefox, in IE when I try to add to cart it brings up the file open/save dialog box.  I've looked around for solutions and tried playing around with it but haven't been able to make any progress.  Does anyone have any suggestions?

Thx in advance for any help!

Re: Ajax problem with depot application

I knew this would happen.  Please ignore this post I was being a little retarded.  I followed along with the book and have been doing the additional excercises to try out on your own.  Well one of those was to allow the images to be clickable and when clicked they would add to cart.  However I didn't update the image tag with an ajax call.  At any rate I think I've fixed my minor retardation problem.