Plugin details

The Track allows you to easily redirect the users to the page they wanted to visit after they log in.

Repositoryhttp://julik.textdriven.com/svn/tools/rails_plugins/track/ Author Julik Tags redirect, http LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://julik.textdriven.com/svn/tools/rails_plugins/track/

Bouncing allows you to have simple "savepoints" maintained in your controllers (also known as the session trail). Savepoints help you to "bounce" the user to the last page he has been browsing when he hits an action that, for any reason, cannot be processed. For instance, shall your user hit "Administration" controller without having appropriate rights from "People#list" page, he will be automatically sent back to this page by the "Administration" controller with an appropriate message in the flash. By default, only requests which are full-fledged "get" requests (that is, no POSTed forms or AJAX fragment calls) are recorded as savepoints. If you want to omit an action from being recorded as savepoint, you can call keep_track! within your action.

Any controller that uses Track also recieves a method called default_pin which return the default URL to record for this controller if no savepoint URL can be deducted.

Bouncing works with GET requests, so all parameters are preserved. This also opens possibilities for some nice interactions. If, for instance, you use scaffold-style redirects (redirecto to the "list" after an "update" etc.) right now you can allow actions to be hit from any controller, redirecting back to this controller after an action has completed.

It can be easily used for bouncing the user to the login form, allowing him to login and then redirecting him to the original page he wanted to view.

Please note that SessionTrack does not give you any "backtracking" in the real sense of this word - it will not rollback the application state to the last savepoint, it's just a way to allow the user to navigate and redirect him in a meaningful way.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago