> I have a login form on the left side of a page.
>
> The user can always log in at any time this way.
>
> when they do I use redirect :back as an easy way to get back to the
> page
> they were viewing before they attempted to log in.
>
>
> Problem I am having is that if they make an error when logging in
> and I
> redirect them back the username won''t show up because of the
redirect.
>
> Is there an Rails way of getting the username to show up in the form
> so
> they can correct any typos.
>
> The password field being empty works well in this case.
redirect :back and the ''back button'' aren''t the same
thing. The
former is just a convenient shortcut for sending the user to another
page via an HTTP redirect.
That said, sometimes the back button doesn''t save form fields either.
Store the username in a cookie and use some javascript to prefill the
login box if that cookie exists.
-philip
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---