I’m creating an order entry application based on the depot application
in Dave Thomas’s book “Agile Web Development with Rails”, except one
major difference is that I want the user to be allowed to have any
number of orders open at a time. The idea is that a sales
representative will, in the process of creating an order, drag and drop
any number of line_items onto the order and using AJAX the items on the
order will be updated. At this point, the order has not yet been saved
so I’m storing the line_items in a session variable. However, when I have two orders open at the same time the session variable gets applied to both orders, and any
items added to one order are also added to the other.
That said, I need to find an alternative solution and I’m
wondering what would be the best way to do this? I’m hoping there’s a
more elegant solution than updating a hidden input in the form. Any suggestions would be appreciated.
PS The AJAX code was taken from the shopping cart demo on script.aculo.us