Hi,
I’m following the book Agile Web D. with Rails and I have
finished to implement the action “remove_from_cart†which is one of the
task in the Playtime section of page 139.
Everything works well; I highlight the current_item which has been
modify, and I even subtract the item from the cart when the quantity is
= 0. However the highlight trick give an error when I extract the last
item, and it make sense because there is note current_item any more.
How can I make this effect happen only when quantity is > 0?
Here I leave what I’m doing but it’s not working.
remove_from_cart.js
—-—-—-——---------------
page.replace_html(“cart†, :partial => “cart†, :object => @cart)
page[:cart].visual_effect :blind_up if @cart.total_items <= 0
if page[:current_item] page[:current_item].visual_effect :highlight,
:startcolor => â€#88ff88â€, :endcolor => â€#114411â€
end
Thanks in advance
