# Implementing an atomic wizard with new objects

**URL:** <https://www.ruby-forum.com/t/implementing-an-atomic-wizard-with-new-objects/169421>\
**Category:** Rails\
**Created:** [June 3, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/implementing-an-atomic-wizard-with-new-objects/169421 "2009-06-03T15:54:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@charan](https://www.ruby-forum.com/u/charan)\
**Post date:** [June 3, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/implementing-an-atomic-wizard-with-new-objects/169421/1 "2009-06-03T15:54:32Z")

</div>

Hello after having searched the forums I couldn’t find any soution to  
this problem:

I want to implement a multi step form across models.

Step 1: Enter requested username/ password - User model  
Step 2: Enter Profile information - Profile model  
Step 3: Misc questions - Questionaire model  
Step 4: Accept settings and save

The problem is if a user is created in step 1 and then exits his  
browser during step 2, thus a record in the users table is dangling,  
no good.

The best solution would be to have a Wizard controller with each step  
being associated with a method. Ive looked at the Wizard plugin  
([http://github.com/crankin/wizard/tree/master](http://github.com/crankin/wizard/tree/master)), however it doesnt seam  
like it addresses the issue mentioned above.

and also problem with back button in the browser,what if the user  
press back at step 3 and goes back to step 1 and start it…offcourse  
we can update it using update\_attribute but it create many round trip  
to DB

Ive also looked as acts\_as\_statemachine but I dont know how I can get  
it to work with e.g. the wizard plugin.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![charan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@charan](https://www.ruby-forum.com/u/charan)\
**Post date:** [June 3, 2009, 4:11pm UTC](https://www.ruby-forum.com/t/implementing-an-atomic-wizard-with-new-objects/169421/2 "2009-06-03T16:11:41Z")

</div>

charan wrote:

> The problem is if a user is created in step 1 and then exits his  
> browser during step 2, thus a record in the users table is dangling,  
> no good.

Please solve this problem. I’m trying to sign up, and don’t notice the  
oncoming  
electrical storm. On page 2 the lights go out. When I reboot and  
recover, 59  
minutes later, I should be able to resume page 2.

Save your dangling records, and allow some innocuous event, such as  
someone  
hitting a list of users, to reap the danglers that are older than one  
day.

–  
Phlip
