backtracker
This is only a test gem. Ruby gem which allows you to take user or someone else, using your application, back to a previous path or url if needed
Installation
In your Gemfile :
gem 'backtracker'
and then run the command
bundle install
Usage
In your controller action you can save your “location” by using method :
store_current_path( args = nil )
args should be an hash wich contains a :path value and / or :controller and :action values,
store_current_path( :controller => "your_controller", :action => "your_action" )
( mass assign them ! ) If you do not specify a path or url backtracker takes the current one automatically. If you're using CanCan gem ( for example ) you can rescue application from an access denied error like this:
rescue_from CanCan::AccessDenied do |exception| restore_previous_path end
Use it this way on exceptions like that.
Contributing to backtracker
-
Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
-
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.
-
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
Copyright © 2013 rexos. See LICENSE.txt for further details.