Download Plugin (zip)

Stats

Version

0.101

Wheels Compatibility

1.0.1, 1.0

Downloads

102

Last Updated

February 21, 2010

About Plugins

Plugins allow you to extend or modify default Wheels application behavior. To use, you just drop the zip file into your plugins directory and reload your application.

Read Using and Creating Plugins for more information.

Better Redirects

This plugin adds some redirect helpers. It's based on a blog post by Connor McKay: Better Redirects in Rails.

Author

Clarke Bishop

Description

The methods provided by this plugin extends and enhances the redirect helpers provided by Wheels.

Here's an example requirement. For user authentication, it is typical to do a redirect to a login page when the user tries to access a protected page. But, where do they go after login? It is nice to remember their original URL and send them back. RedirectAway() and RedirectBack() make this easy.

Usage/Examples

Here is a listing of the methods that are added by this plugin.

  • FlashRedirectToIndex (flashMessage) - Inserts a notice message into the the Flash and redirects to the index action..
  • FlashRedirect (flashMessage, [value]) - Inserts a notice message into the the Flash and calls RedirectTo(). You can pass any RedirectTo values to the method.
  • RedirectAway (variableName, [value]) - Saves the currentURL to the session, and calls RedirectTo(). You can pass any RedirectTo values to the method.
  • RedirectBack (variableName, [value]) - If the currentURL is defined in the session, redirects there. If it isn't defined, calls RedirectTo().

Change Log

Version 0.101—February 21, 2010 Download

Updated version to 1.01


Wheels compatibility: 1.0, 1.0.1.

Version 0.1—November 15, 2009 Download

  • Initial release.
  • Wheels compatibility: 1.0.