small medium large xlarge

308609_10150417437484992_522739991_10780430_6337239_n_pragsmall
03 Mar 2010, 02:37
Trung Lê (10 posts)

IMHO, I don’t think highlighting item with id=”current_item” is a good thing. I think for every line of item should be asign with id=”cart_item_" then we use JS to highlight the current_item.id. Here is my code in jQuery:

add_to_cart.js.erb:

$(‘#cart_item_’ + <%= @current_item.id %>).pulse({ opacity: [0,1] }, { times: 1
});

and append to CartItem model

def id @product.id end

Thanks

You must be logged in to comment