A
Angel Dinar
Hello
I am reading Agile Web Development 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</div>\n<table>\n \n\n\n<!-- START_HIGHLIGHT -->\n\n <tr
id=\"current_item\"> \n\n<!-- #END_HIGHLIGHT -->\n\n\n\n\n<tr>\n
<td>7×</td>\n <td>Pragmatic Project Automation</td>\n <td
class=\"item-price\">$209.65</td>\n</tr>\n\n\n <tr
class=\"total-line\">\n <td colspan=\"2\">Total</td>\n <td
class=\"total-cell\">$209.65</td>\n </tr>\n\n</table>\n\n<form
method=\"post\" action=\"/store/empty_cart\"
class=\"button-to\"><div><input type=\"submit\" value=\"Empty cart\"
/><input name=\"authenticity_token\" type=\"hidden\"
value=\"6ZdrTVjPgu0Lls4YyuTXbg1an5X/KKNZJKgDfruU6Qo=\"
/></div></form>\n");
$("current_item").visualEffect("highlight",
{"endcolor":"#114411","startcolor":"#88ff88"});
} catch (e) { alert('RJS error:\n\n' + e.toString());
alert('Element.update(\"cart\", \"\\n\\n<div
class=\\\"cart-title\\\">Your Cart</div>\\n<table>\\n \\n\\n\\n<!--
START_HIGHLIGHT -->\\n\\n <tr id=\\\"current_item\\\"> \\n\\n<!--
#END_HIGHLIGHT -->\\n\\n\\n\\n\\n<tr>\\n <td>7×</td>\\n
<td>Pragmatic Project Automation</td>\\n <td
class=\\\"item-price\\\">$209.65</td>\\n</tr>\\n\\n\\n <tr
class=\\\"total-line\\\">\\n <td colspan=\\\"2\\\">Total</td>\\n
<td class=\\\"total-cell\\\">$209.65</td>\\n
</tr>\\n\\n</table>\\n\\n<form method=\\\"post\\\"
action=\\\"/store/empty_cart\\\" class=\\\"button-to\\\"><div><input
type=\\\"submit\\\" value=\\\"Empty cart\\\" /><input
name=\\\"authenticity_token\\\" type=\\\"hidden\\\"
value=\\\"6ZdrTVjPgu0Lls4YyuTXbg1an5X/KKNZJKgDfruU6Qo=\\\"
/></div></form>\\n\");\n$(\"current_item\").visualEffect(\"highlight\",
{\"endcolor\":\"#114411\",\"startcolor\":\"#88ff88\"});'); throw e }
I am reading Agile Web Development 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</div>\n<table>\n \n\n\n<!-- START_HIGHLIGHT -->\n\n <tr
id=\"current_item\"> \n\n<!-- #END_HIGHLIGHT -->\n\n\n\n\n<tr>\n
<td>7×</td>\n <td>Pragmatic Project Automation</td>\n <td
class=\"item-price\">$209.65</td>\n</tr>\n\n\n <tr
class=\"total-line\">\n <td colspan=\"2\">Total</td>\n <td
class=\"total-cell\">$209.65</td>\n </tr>\n\n</table>\n\n<form
method=\"post\" action=\"/store/empty_cart\"
class=\"button-to\"><div><input type=\"submit\" value=\"Empty cart\"
/><input name=\"authenticity_token\" type=\"hidden\"
value=\"6ZdrTVjPgu0Lls4YyuTXbg1an5X/KKNZJKgDfruU6Qo=\"
/></div></form>\n");
$("current_item").visualEffect("highlight",
{"endcolor":"#114411","startcolor":"#88ff88"});
} catch (e) { alert('RJS error:\n\n' + e.toString());
alert('Element.update(\"cart\", \"\\n\\n<div
class=\\\"cart-title\\\">Your Cart</div>\\n<table>\\n \\n\\n\\n<!--
START_HIGHLIGHT -->\\n\\n <tr id=\\\"current_item\\\"> \\n\\n<!--
#END_HIGHLIGHT -->\\n\\n\\n\\n\\n<tr>\\n <td>7×</td>\\n
<td>Pragmatic Project Automation</td>\\n <td
class=\\\"item-price\\\">$209.65</td>\\n</tr>\\n\\n\\n <tr
class=\\\"total-line\\\">\\n <td colspan=\\\"2\\\">Total</td>\\n
<td class=\\\"total-cell\\\">$209.65</td>\\n
</tr>\\n\\n</table>\\n\\n<form method=\\\"post\\\"
action=\\\"/store/empty_cart\\\" class=\\\"button-to\\\"><div><input
type=\\\"submit\\\" value=\\\"Empty cart\\\" /><input
name=\\\"authenticity_token\\\" type=\\\"hidden\\\"
value=\\\"6ZdrTVjPgu0Lls4YyuTXbg1an5X/KKNZJKgDfruU6Qo=\\\"
/></div></form>\\n\");\n$(\"current_item\").visualEffect(\"highlight\",
{\"endcolor\":\"#114411\",\"startcolor\":\"#88ff88\"});'); throw e }