back_to_referer_after_form

Adds a redirect_back_or_to method so after edit/create/destroy it redirects to the FORM referer (usually two steps back from the action) or to the explicit redirection target if there’s no place to get back.

Warning

Versions Prior 0.1.6 includes the module in ApplicationController in a bad way breaking the application. DO NOT USE VERSIONS <= 0.1.5

Using

  • Include BackToRefererAfterForm in ApplicationController or in your chosen controllers

  • Use redirect_back_or_to instead redirect_to after succeded save in controllers.

Contributing to back_to_referer_after_form

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet (Versions prior to 0.1.2 don’t work at all)

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally. (I don’t do test, don’t know how to. I’m a rails newbie)

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Alfredo Daniel Rezinovsky. See LICENSE.txt for further details.