Path: | lib/merb-auth-more/mixins/redirect_back.rb |
Last Update: | Sat Aug 21 15:43:36 -0600 2010 |
Impelments redirect_back_or. i.e. remembers where you‘ve come from on a failed login and stores this inforamtion in the session. When you‘re finally logged in you can use the redirect_back_or helper to redirect them either back where they came from, or a pre-defined url.
Here‘s some examples:
1. User visits login form and is logged in - redirect to the provided (default) url 2. User vists a page (/page) and gets kicked to login (raised Unauthenticated) - On successful login, the user may be redirect_back_or("/home") and they will return to the /page url. The /home url is ignored