# Paradigm for creating an object over several form screens?

**URL:** <https://www.ruby-forum.com/t/paradigm-for-creating-an-object-over-several-form-screens/110843>\
**Category:** Rails\
**Created:** [July 31, 2007, 2:15pm UTC](https://www.ruby-forum.com/t/paradigm-for-creating-an-object-over-several-form-screens/110843 "2007-07-31T14:15:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 31, 2007, 2:15pm UTC](https://www.ruby-forum.com/t/paradigm-for-creating-an-object-over-several-form-screens/110843/1 "2007-07-31T14:15:54Z")

</div>

What’s the best way to create and edit an object over several form  
screens before submitting it to the db?

I have an ‘edit\_story’ form page, which has buttons for ‘add picture’  
and ‘add\_movie’. If the user selects either of these, they go to a  
different screen to select and set properties for the movie or picture  
they’re uploading. Then they go back to the edit\_story page, which  
should of course remember everything they’ve done so far. Once they’ve  
done all their editing and movie/picture adding, they hit ‘submit’ on  
the ‘edit\_story’ page and the data is saved to the DB.

What’s the standard way of achieving this? Is it to pass a partially  
constructed object around between the various screens, re-filling the  
fields with its properties each time? Or to build the object up in the  
db and then delete it if the user doesn’t submit? Or something more  
elegant in the controller? or something else?

any advice welcome - thanks!

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [July 31, 2007, 2:47pm UTC](https://www.ruby-forum.com/t/paradigm-for-creating-an-object-over-several-form-screens/110843/2 "2007-07-31T14:47:35Z")

</div>

On Jul 31, 5:15 am, Max W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> What’s the standard way of achieving this? Is it to pass a partially  
> constructed object around between the various screens, re-filling the  
> fields with its properties each time? Or to build the object up in the  
> db and then delete it if the user doesn’t submit? Or something more  
> elegant in the controller? or something else?
> 
> ## any advice welcome - thanks!
> 
> Posted viahttp://www.ruby-forum.com/.

google for multi-step, sequential, multistage, etc forms:  
[http://wiki.rubyonrails.com/rails/pages/HowToBuildMultiStageForms](http://wiki.rubyonrails.com/rails/pages/HowToBuildMultiStageForms)

[http://snippets.dzone.com/posts/show/277](http://snippets.dzone.com/posts/show/277)  
[http://railsforum.com/viewtopic.php?id=721](http://railsforum.com/viewtopic.php?id=721)
