Hi, I am slowly learnng ROR and wondering if anyone can point me in the general direction to go with the following problem. User is filling out a form (question model) and needs to leave the page to select an image from a gallery (picture model). When the user selects and saves the image they are redirected back to the original form. How is this done without reloading the question form and losing the data? Is there a standard for doing this? I have considered saving when leaving page and redirecting to edit/update form but cant save data unless all fields filled out due to validation. I am having fun learning Rails so even a clue as to direction to take would be helpful. I''m happy to spend the time figuring out the details... 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 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.
On Apr 4, 2013, at 7:50 PM, Dave Castellano wrote:> I have considered saving > when leaving page and redirecting to edit/update form but cant save data > unless all fields filled out due to validation.Well, you can put what the user entered in the session, which you should really be careful about--you really shouldn''t store a lot of data in the session, so this is kind of a quick and dirty hack suggestion. You can have a table for partially-filled forms, which is not subject to validation, and save to that during editing, and move data from there to the "real" table on commit. You can add an "in-progress" flag to your table, and check that during validation. In both of the latter cases, you need a timestamp and some process to purge data that results from abandoned sessions. -- Scott Ribe scott_ribe-ZCQMRMivIIdUL8GK/JU1Wg@public.gmane.org http://www.elevated-dev.com/ (303) 722-0567 voice -- 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.
On Apr 4, 2013 8:51 PM, "Dave Castellano" <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > Hi, > > I am slowly learnng ROR and wondering if anyone can point me in the > general direction to go with the following problem. > > User is filling out a form (question model) and needs to leave the page > to select an image from a gallery (picture model). When the user > selects and saves the image they are redirected back to the original > form. How is this done without reloading the question form and losing > the data? Is there a standard for doing this? I have considered saving > when leaving page and redirecting to edit/update form but cant save data > unless all fields filled out due to validation. > > I am having fun learning Rails so even a clue as to direction to take > would be helpful. I''m happy to spend the time figuring out the > details... > > Thanks!my suggestion is to use a modal jquery dialog at the point they will select the image so you don''t actually take them off the form page. -- 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.
+1 for using some sort of dialog. That would honestly be better for the overall UX. -- 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.