I’m trying to implement a remove from cart method based on the
examples in the second edition Agile book. I have everything working
except for the RJS that removes items from the cart. Ideally what
I’d like to do is highlight an element that I am deleting only if
there is more than one of that particular item in the cart. If the
item deleted is the only of it’s kind it gets removed from the
document before the highlight is “activated”.
page[:cart].replace_html :partial => ‘cart’, :object => @cart
:startcolor => “#88ff88”,
:endcolor => “#114411”
Is there a way to use RJS to see if page[@div] (in this case) exists
before I try to do the highlight?