Rails plugin to make it easier to redirect back to actions by storing the return path in the session.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
README
init.rb
install.rb

README

Makes it easier to redirect back to actions by storing the return path in the session.

Place this in application_controller.rb:

    include RedirectBack
    
Then, in a controller:

    before_filter :store_return_point, :only => [:list]

    def list
    end

    def edit
      # do your editing...
      redirect_back :action => "list"
    end
    
If redirect_back is accessed through an action which utilizes :store_return_point, it will use the path stored in the session to redirect to. Otherwise it will use the hash passed to it.

link_back can be used in views in exactly the same way:

    <%= link_back "Back", :action => "list" %>