Is there a clever rails way to chain multiple forms together to collect
all the info that I need before finally calling “save”?
For example consider an app which needs to create a “Order” object which
is tied to a “Contact” object which may or may already exist. Lets
pretend we don’t want to save the order to the DB until the contact info
is known and both objects must be saved atomically.
We have a form for editing Orders, and a Form for editing Contacts. We
call the Orders form first and obtain the info, now I want to stash the
detail somewhere while I go and obtain the Contact data. What is a good
way to serialise that data while we call the Contact form? Lots of apps
like to stuff it in as a serialised hidden field so that you don’t have
problems with multiple sessions at the same time - how might we go about
this in Rails?