I''m still learning rails and would like to know the best way to proceed. I have a wizard interface where I''d like to allow the user to create an Event, along with several children models, some of which are children via has-many through relationships. I''ve started by creating partials under Event (step1,step2,step3) etc. each with their own form. I''ve using all remote=>true ajax calls and hiding/showing the different step partials after each submission. I''m leveraging accepts nested attributes to do everything through the Event. Is this the best approach? Should I instead have a initial form to create the base Event model (step 1). Then take them to a different controller to create one of the child objects? If so should it be a view on the junction object? (ex. event location is a junction between event and locations) Hopefully this made sense, I''m just looking for some direction and advice. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
You need to build new objects and save after last step. Or save all dates on session and save. Why do you not use the wizard gem? -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
One thing I forgot to mention is at one stage of the form they''ll need to create children for records that were built in an earlier step. Example (you create several children for the event in step 2 and in step 3 you create children for those) -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
I''ve done this before in general, create an attribute (call it :stage) - base your view names and validation rules upon :stage :stage can be virtual, or if you store it you could allow someone to return to entry later for a more advanced implementation you could use a state machine (instead of stage) - which may give you more power if you want to process the data entered asynchronously On Sat, Feb 9, 2013 at 10:24 AM, Phil Bee <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> One thing I forgot to mention is at one stage of the form they''ll need > to create children for records that were built in an earlier step. > Example (you create several children for the event in step 2 and in step > 3 you create children for those) > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.