if we add an item to the shopping cart, the AJAX is easy: the View adds an item to the cart, and also set the "current_item_added" and then just let the view (RJS) update the whole cart content, and then blink the current_item_added, and that''s it. but what about now it is deleting an item, and it is the last item in the cart, so how do you let the Controller find that item, and let the View blink it, and then come back to the Controller to delete that item, and then go to the View again to update the new cart? I can think of letting the Controller dup the original cart first as old_cart(need deep copy?), and then passing the following to the View: 1. current_item_deleted 2. old_cart 3. new_cart and then let the RJS blink the current_item_deleted with the old_cart, and then, display the cart using new_cart. is this not proper, or is there a proper MVC way? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---