Pat Maddox
2007-Jan-08 03:19 UTC
AR object takes several forms to complete...how should I handle that?
In one of the apps I''m building, the user fills out a series of forms that will eventually create an AR model. What''s the best way to handle the object throughout the process? I could save it at each step, though that could leave us with tons of crap objects in the db. Another option is to just create an object without saving it, and pass it into each view. Then I would use hidden fields in the forms to pass along the already submitted info. The final idea that I''m thinking of is to hold onto the object using the session. I could use flash to ensure they don''t stay in too long. One major consideration is that I''m not sure what all the steps are at this point, and they''ll definitely be changing. Some users will have different steps than others. The forms will be standard fare, just a bunch of strings and numbers. They will upload a picture or two. With all that in mind, what are the pros and cons of each approach I mentioned above? Are there any other approaches that may work better? Thanks for any advice. Pat --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bill Walton
2007-Jan-08 03:40 UTC
Re: AR object takes several forms to complete...how should I handle that?
Hi Pat, Pat Maddox wrote:> I could save it at each step, though that could leave us with tons of crap > objects > in the db.Not sure I''m following, so I hope you''ll forgive a potentially stupid question. Are you talking about session clean-up issues? If not, could you say more about what you''re concerned about here? Thanks, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Pat Maddox
2007-Jan-08 04:18 UTC
Re: AR object takes several forms to complete...how should I handle that?
On 1/7/07, Bill Walton <bill.walton-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> > Hi Pat, > > Pat Maddox wrote: > > I could save it at each step, though that could leave us with tons of crap > > objects > > in the db. > > Not sure I''m following, so I hope you''ll forgive a potentially stupid > question. Are you talking about session clean-up issues? If not, could you > say more about what you''re concerned about here?Sorry, I meant that I could save it to the db after every step. If someone cancels halfway through though, there''s a trash record in the db (I''d have to skip validations to get it to save in the first place, because they won''t have entered all the necessary info). Pat --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
2007-Jan-08 04:35 UTC
Re: AR object takes several forms to complete...how should I handle that?
Hi -- On Sun, 7 Jan 2007, Pat Maddox wrote:> > On 1/7/07, Bill Walton <bill.walton-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote: >> >> Hi Pat, >> >> Pat Maddox wrote: >> > I could save it at each step, though that could leave us with tons of >> crap >> > objects >> > in the db. >> >> Not sure I''m following, so I hope you''ll forgive a potentially stupid >> question. Are you talking about session clean-up issues? If not, could >> you >> say more about what you''re concerned about here? > > Sorry, I meant that I could save it to the db after every step. If > someone cancels halfway through though, there''s a trash record in the > db (I''d have to skip validations to get it to save in the first place, > because they won''t have entered all the necessary info).Just FYI here''s some musings on this subject by Zed Shaw: http://rubyforge.org/pipermail/mongrel-users/2006-September/001429.html David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.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 -~----------~----~----~----~------~----~------~--~---