Wizard-like multi-page transaction

Hello

Is it possible to create something like wizard with database
transactions, so transaction would begin on page one, then on page two,
three… etc. there would be some data altered in the database and then
on the last page the transaction would be committed or rolled back?

thx
Zvonko

I think it might be easier to just store your data in the session
until you reach the final step, then you could commit it all just at
the end.

So, you could have:

Step 1: Enter name
session[:name] = ‘some name’
Step 2: Enter credit card
session[:credit_card] = blah

And at the end, you could just grab those values and add them to your
Active Record objects and save. You should probably remove them from
the session too.

Tom

On 7/31/06, Zvonko [email protected] wrote:


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Tom D.

http://atomgiant.com
http://gifthat.com

On Monday, July 31, 2006, at 5:23 PM, Tom D. wrote:

transactions, so transaction would begin on page one, then on page two,
[email protected]
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

While this suggestion is a good one, I have to ask: if you have so many
fields in your model, might it be possible to break it up into smaller
models?

I’ve written a wizard that moves through multiple steps in a process.
Each step happens to correspond to a different model.

_Kevin
www.sciwerks.com