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 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to