backpedal 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -6
- data/lib/backpedal/actions.rb +7 -1
- data/lib/backpedal/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b67bb1087008f4342567ec4abccfe9875a418b66002d1c07c4bbbd31a0f26835
|
4
|
+
data.tar.gz: bd06cb1fa0e33d4972bb63b5bcc26c4d6f3fcaac43ad9a106f40ca7fbf90a2c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e335d2deb4ee4e577a985c1639f636f4d8ba14c84e6468005343fdf95b64e223fbe386dc08fcc6e13762d4b7a3f2c2ed65b2f34979fc60d13148ee0c76c688cd
|
7
|
+
data.tar.gz: c185118d6316d9207552684dc78220be46b849ebefccd414aafc76fed584c14a0ad00a3e4c52aff2b98811f26559baa52eb252f5d2560216171100452e52f964
|
data/README.md
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
# Backpedal
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/backpedal`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
Give your users the ability to backpedal across any number of routes in your app.
|
2
|
+
This gem provides developers a simple way to capture a users navigational path across multiple routes in their app. So for example, if a user is looking at a specific order(orders_controller), and they click on a product description(products_controller), the back link on this page would take them back to the order they were looking at. If the user arrived at the product view from the index action on the products controller the same back link would take them back to the index view they were on previously.
|
8
3
|
|
9
4
|
## Installation
|
10
5
|
|
data/lib/backpedal/actions.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
module Actions
|
2
2
|
|
3
|
+
if Backpedal.configuration.blank?
|
4
|
+
@@skipped_verbs = ['new', 'edit', 'delete', 'destroy']
|
5
|
+
else
|
6
|
+
@@skipped_verbs = Backpedal.configuration.skipped_verbs
|
7
|
+
end
|
8
|
+
|
3
9
|
extend ActiveSupport::Concern
|
4
10
|
|
5
11
|
def capture_path
|
@@ -13,7 +19,7 @@ module Actions
|
|
13
19
|
# remove this page from the stack if the user was just here(clicked back link)
|
14
20
|
tree.pop
|
15
21
|
session[:tree] = tree.join(",")
|
16
|
-
elsif request.referer.present? and request.referer != tree.last and
|
22
|
+
elsif request.referer.present? and request.referer != tree.last and @@skipped_verbs.exclude? request.referer.split("/").last.split("?")[0]
|
17
23
|
tree << previous_page
|
18
24
|
session[:tree] = tree.join(",")
|
19
25
|
end
|
data/lib/backpedal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backpedal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greyoxide
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,8 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.7.3
|
82
|
+
rubygems_version: 3.0.1
|
84
83
|
signing_key:
|
85
84
|
specification_version: 4
|
86
85
|
summary: A Rails gem that gives your users a universal back link across multiple routes.
|