small medium large xlarge

Generic-user-small
20 Feb 2010, 21:51
gr33d (3 posts)

My infamous Yellow Fade Technique isn’t working. I verified my source files match that of the book, and I tried restart my web server to no avail. FireFox browser.

The only answer I can find is whether the “defaults” javascript tag includes the scriptulous effects.js file. I can see the effects.js file in /depot/public/javascripts/, but I’m not sure if it needs an extra javscript_include_tag or if it is automatically included? If it’s included, any ideas why it isn’t working?

Thanks in advance!

Samr_small_pragsmall
20 Feb 2010, 23:08
Sam Ruby (634 posts)

Go to the web page, and view source. Do you see the following?

< script src="/javascripts/effects.js?1266373732" type="text/javascript">< /script>

If you do, something to try from the command line:

curl -H 'X-Requested-With: XMLHttpRequest' http://localhost:3000/store/add_to_cart/4

Alternately, get FireBug, and take a look at the XMLHttpRequest there:

http://getfirebug.com/network
Generic-user-small
21 Feb 2010, 03:54
gr33d (3 posts)

I emptied the cart, started monitoring, added item 3 to the cart, and the FB response is as follows:

try { Element.update("cart", "<div class=\"cart-title\">Your Cart</div>\n<table>\n \n <tr id=\"current_item\">\n\n<tr>\n <td>1&times;</td>\n <td>Pragmatic Project Automation\n <td class=\"item-price\">$29.95</td>\n</tr>\n\n\n <tr class=\"total-line\">\n <td colspan=\"2\">Total</td>\n <td class=\"total-cell\">$29.95</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=\"d3d1c7c9bf133d9920aaded7c7c285355f677727\" /></div></form>\n"); $("current_item").visualEffect("highlight", {"startcolor": "#88ff88", "endcolor": "#114411"}); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"cart\", \"<div class=\\\"cart-title\\\">Your Cart</div>\\n<table>\\n \\n <tr id=\\\"current_item\\\">\\n\\n<tr>\\n <td>1&times;</td>\\n <td>Pragmatic Project Automation\\n <td class=\\\"item-price\\\">$29.95</td>\\n</tr>\\n\\n\\n <tr class=\\\"total-line\\\">\\n <td colspan=\\\"2\\\">Total</td>\\n <td class=\\\"total-cell\\\">$29.95</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=\\\"d3d1c7c9bf133d9920aaded7c7c285355f677727\\\" /></div></form>\\n\");\n$(\"current_item\").visualEffect(\"highlight\", {\"startcolor\": \"#88ff88\", \"endcolor\": \"#114411\"});'); throw e }

Samr_small_pragsmall
21 Feb 2010, 04:33
Sam Ruby (634 posts)

Looking at that data, I see two tr elements, one with an id=current_item and no td’s. A second one with td elements. In words, that’s two rows, one that will be highlighted but has no columns, and one that will not be highlighted, and has the data.

My guess is that the problem is in app/views/store/_cart_item.html.erb, probably something to do with the else statement.

Generic-user-small
22 Feb 2010, 12:56
gr33d (3 posts)

I duplicated the <tr> tag after the if-else in app/views/store/_cart_item.html.erb–probably could’ve seen it earlier if I was in an IDE instead of terminal! ;)

Thanks!

You must be logged in to comment