I am working on a crude first-go-round-in-rails shopping cart and
can’t figure out for the life of me the best way to do this. I have a
shopping cart that has one page during the checkout that handles the
address information, then the next handles the actual credit card
information. How do I take the information from the address form and
keep it alive long enough to put it in to the cart and then database
once the order is accepted?
One scenario I thought of is to store the customer address
information in the database and just link the order to the customer
in the database. The only problem with that is if I save the address
info into the db before the order is completed, I have the
possibility of a ton of unused addresses in the database.
Is there a way to hold off on a database save for a page? If that
happens, can I keep the validation from the model working on the
first page (ie without a save)?
Thanks for any help.