Forum: Ruby on Rails Multi-page forms...again :-(

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0ccfc4935cd968d289decc405604a2ca?d=identicon&s=25 Matthew Law (Guest)
on 2006-04-14 13:29
(Received via mailing list)
I am building a listings site which has quite a long process for adding
a new listing.  I want to avoid saving partially complete listings to
the database to save space (and I would have to disable constraints for
some of the lookup tables used in the select lists, which is bad).  I am
thinking that the best option is to build up a listing in the session
and save it after the user confirms the whole thing on the last page.
It is a little more complicated than this as they will need to upload
multiple images and PDFs before the listing is saved, but you get the
idea.

So, which way to go?  Do I do an uber-validation at the point of saving
the listing object and then try to work out what went wrong and on which
page, or do I validate each form as it is submitted and then save the
whole lot without validating it?  Is there an easy way of storing data
to the session instead of the database - like ActiveRecord but using the
session instead?  Someone mentioned using the Acts as State Machine
plugin, which I have looked at but, being a noob, I can't see where that
would help me :-/

As I said, I'm a rails newbie and this is proving to be a bit of a tough
one for me, so I would be very grateful for any links, code snippets
etc.


TIA,

Matt.
This topic is locked and can not be replied to.