backtracker 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/backtracker.rb +5 -0
  2. data/lib/store_path.rb +15 -0
  3. metadata +47 -0
@@ -0,0 +1,5 @@
1
+ require "store_path"
2
+
3
+ class ActionController::Base
4
+ include StorePath
5
+ end
data/lib/store_path.rb ADDED
@@ -0,0 +1,15 @@
1
+ module StorePath
2
+
3
+ def store_current_path( path = nil )
4
+ if path.nil?
5
+ session[:previous_path] = request.fullpath
6
+ else
7
+ session[:previous_path] = path
8
+ end
9
+ end
10
+
11
+ def restore_previous_path
12
+ redirect_to session[:previous_path]
13
+ end
14
+
15
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: backtracker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alex Pellegrini
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-06-08 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Takes user or someone else back to previous path or url if needed
15
+ email: alex.pellegrini@live.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/backtracker.rb
21
+ - lib/store_path.rb
22
+ homepage: http://rubygems.org/gems/backtracker
23
+ licenses:
24
+ - Open Source
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 1.8.23
44
+ signing_key:
45
+ specification_version: 3
46
+ summary: Stores previous url/path
47
+ test_files: []