small medium large xlarge

Books_pragsmall
29 Dec 2008, 12:15
Ben S. Knowles (2 posts)

And Safari then spews a dialog full of this:

Element.update("cart", "<div class=\"cart-title\">Your Depot Cart</div> \n\n  <table>\n    \n\n\t<tr>\n\n  <td>5&times;</td>\n  <td>Sandworms of Dune</td>\n  <td class=\"item-price\">$15.00</td>\n</tr>\n\n\n  <tr id=\"current-item\">\n\n  <td>5&times;</td>\n  <td>Hunters of Dune</td>\n  <td class=\"item-price\">$20.00</td>\n</tr>\n\t\n      <tr class='total-line'>\n        <td colspan=2>Total:</td>\n\t\t\t\t<td class='total-cell'>$35.00</td>\n      </tr>\n  </table>\n\n<form method=\"post\" action=\"/store/empty_cart\" class=\"button-to\"><div><input type=\"submit\" value=\"Empty the cart?\" /><input name=\"authenticity_token\" type=\"hidden\" value=\"34e7bc3aa8ad32f2cf977ccaa1c5da92b22a3ac3\" /></div></form>\n \n");
$("current_item").visualEffect("highlight", {"endcolor": "#114411", "startcolor": "#88ff88"});

Interestingly, as can be seen from the output above the tr is correctly id current-item. The previous round of Ajax changes is working fine, and the cart updates in the sidebar, even when the errors fly. Dev log says:

Processing StoreController#add_to_cart (for 127.0.0.1 at 2008-12-29 07:10:10) [POST]
  Session ID: 725832306db6b01f7c809916443ddf60
  Parameters: {"commit"=>"Add Sandworms of Dune to Cart", "authenticity_token"=>"34e7bc3aa8ad32f2cf977ccaa1c5da92b22a3ac3", "id"=>"602372474"}
  Product Load (0.4ms)   SELECT * FROM "products" WHERE ("products"."id" = 602372474) 
Debug: cart: add_product: @current_item is 
Debug: cart#add_product returning #<CartItem:0x227af04>
Debug: store_controller: @current_item is #<CartItem:0x227af04>
Rendering store/add_to_cart
Debug: _cart: #<Cart:0x227af68>
Debug: _cart_item: #<CartItem:0x227af04> @current_item: #<CartItem:0x227af04>
Rendered store/_cart_item (4.6ms)
Debug: _cart_item: #<CartItem:0x227ac84> @current_item: #<CartItem:0x227af04>
Rendered store/_cart_item (0.8ms)
Rendered store/_cart (7.7ms)
Completed in 15ms (View: 11, DB: 2) | 200 OK [http://localhost/store/add_to_cart/602372474]

So, where should I be looking for my typo ? :) I’ll go ahead and dump session, restart Safari and script/server again while I wait :D

Thanks, Ben

You must be logged in to comment