I have a form that includes text string fields and file upload fields (for images). I want to create a confirmation page that displays the text and photos prior to the form being saved.
I initially followed the procedure for multi-step forms from Railscasts ( http://railscasts.com/episodes/217-multistep-forms ), but this method does not seem to work with file attachments because they do not get passed from the form page to the confirmation page in the session.
What are some other common ways to build this?
I did some research and one suggested method was to actually save all of the form data to the database and to add a new field to the database called “active”. This field would be set to false upon the initial save and then updated to true when the confirmation button is clicked on the next page. I would then need to create a method that would exclude any records in the database that are set to “false” any time I am showing data from these models, correct? I’m afraid that could get messy at some point in the future.
Or is there a better way?
Thanks.
You can pass the file object (in bytes) to the next step and do whatever you want with it. Pass it as a parameter to the confirmation link
Edit:
Check this for an example