Max Williams
2007-Jul-31 12:15 UTC
paradigm for creating an object over several form screens?
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! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gene.tani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-31 12:45 UTC
Re: paradigm for creating an object over several form screens?
On Jul 31, 5:15 am, Max Williams <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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! > -- > Posted viahttp://www.ruby-forum.com/.google for multi-step, sequential, multistage, etc forms: http://wiki.rubyonrails.com/rails/pages/HowToBuildMultiStageForms http://snippets.dzone.com/posts/show/277 http://railsforum.com/viewtopic.php?id=721 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---