public
Description: some simple redirect and return_to helpers
Clone URL: git://github.com/bumi/redirect_love.git
name age message
file MIT-LICENSE Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
file README Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
file Rakefile Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
file init.rb Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
file install.rb Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
directory lib/ Mon Jun 09 17:45:49 -0700 2008 added before_filter to save return_to when modu... [bumi]
directory tasks/ Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
directory test/ Wed Jun 04 16:03:06 -0700 2008 initial release [bumi]
README
RedirectLove
============

some simple return_to helpers


redirect_back_or_default( posts_url )
checks if session[:return_to] or params[:return_to] is set otherwise it redirects to the provided URL

adds some helpers to set return_to

methods:

  redirect_back_or_default  (= redirect_back and = redirect_bod)
  redirect_away: saves the current path and redirects
  save_return_to: used in a before_filter to save the params[:return_to] in the session
  link_away: view link helper which adds the return_to params


THANKS TO:
http://ethilien.net/archives/better-redirects-in-rails/
who provided most of this code!


Copyright (c) 2008 Michael Bumann - railslove.com, released under the MIT license