AR object takes several forms to complete...how should I han

In one of the apps I’m building, the user fills out a series of forms
that will eventually create an AR model. What’s the best way to
handle the object throughout the process? I could save it at each
step, though that could leave us with tons of crap objects in the db.

Another option is to just create an object without saving it, and pass
it into each view. Then I would use hidden fields in the forms to
pass along the already submitted info.

The final idea that I’m thinking of is to hold onto the object using
the session. I could use flash to ensure they don’t stay in too long.

One major consideration is that I’m not sure what all the steps are at
this point, and they’ll definitely be changing. Some users will have
different steps than others.

The forms will be standard fare, just a bunch of strings and numbers.
They will upload a picture or two.

With all that in mind, what are the pros and cons of each approach I
mentioned above? Are there any other approaches that may work better?

Thanks for any advice.

Pat

Hi Pat,

Pat M. wrote:

I could save it at each step, though that could leave us with tons of crap
objects
in the db.

Not sure I’m following, so I hope you’ll forgive a potentially stupid
question. Are you talking about session clean-up issues? If not, could
you
say more about what you’re concerned about here?

Thanks,
Bill

On 1/7/07, Bill W. [email protected] wrote:

say more about what you’re concerned about here?
Sorry, I meant that I could save it to the db after every step. If
someone cancels halfway through though, there’s a trash record in the
db (I’d have to skip validations to get it to save in the first place,
because they won’t have entered all the necessary info).

Pat

Hi –

On Sun, 7 Jan 2007, Pat M. wrote:

Not sure I’m following, so I hope you’ll forgive a potentially stupid
question. Are you talking about session clean-up issues? If not, could
you
say more about what you’re concerned about here?

Sorry, I meant that I could save it to the db after every step. If
someone cancels halfway through though, there’s a trash record in the
db (I’d have to skip validations to get it to save in the first place,
because they won’t have entered all the necessary info).

Just FYI here’s some musings on this subject by Zed S.:

http://rubyforge.org/pipermail/mongrel-users/2006-September/001429.html

David


Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (Ruby for Rails)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)