Forum: Ruby on Rails paradigm for creating an object over several form screens?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2007-07-31 14:15
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!
9dfe8c734b0f9b37a4e218425c0a2138?d=identicon&s=25 gene.tani@gmail.com (Guest)
on 2007-07-31 14:47
(Received via mailing list)
On Jul 31, 5:15 am, Max Williams <rails-mailing-l...@andreas-s.net>
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/HowToBuild...

http://snippets.dzone.com/posts/show/277
http://railsforum.com/viewtopic.php?id=721
This topic is locked and can not be replied to.