Skip to content

idlefingers/redirect_back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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" %>

About

Rails plugin to make it easier to redirect back to actions by storing the return path in the session.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages