Situation: A user submits a form. The inputs are in some way invalid. You present the original form. Question: How do you present the original form as the user had it filled out (so they can correct it) rather than in its original state (requiring them to re-enter everything). I have more or less hackish ways of doing this, but wondered how other people were doing it. -faisal --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
flukus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-03 11:09 UTC
Re: Best practices: form fails, now what...
It''s easiest if you post back to the same action that the form is in. Just make sure you set all the class variables. eg: def login @user = params[:user] || User.new if request.post? #login, redirect end end On Mar 3, 6:35 pm, Faisal N Jawdat <fai...-yPPMdBsEuU/QT0dZR+AlfA@public.gmane.org> wrote:> Situation: A user submits a form. The inputs are in some way > invalid. You present the original form. > > Question: How do you present the original form as the user had it > filled out (so they can correct it) rather than in its original state > (requiring them to re-enter everything). > > I have more or less hackish ways of doing this, but wondered how > other people were doing it. > > -faisal--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---