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.
on 2006-04-14 15:29