mrujs_rails 0.1.0.pre.beta.14 → 0.1.0.pre.beta.16
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.
- checksums.yaml +4 -4
- data/lib/mrujs_rails/redirection.rb +8 -8
- data/lib/mrujs_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b23ad71e18cb8e0952208f2b6a10dab8b1b814d1b5cba39815da8f6bea1fb52a
|
4
|
+
data.tar.gz: 5b1173f9c287817b9465730a2ac061ca979131c2fb742c107bd86a9a7dc43d8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00853b4cc33b9226fb741b59e41a51e1a35fb0846ff39cc45a9bda4497d79e777e1829a8eb009e8682688b19bbc5b0f16810d1015fcf055e94e0d866df82b23
|
7
|
+
data.tar.gz: 55e6cf87fe17c76c9a0ed9bff90408de97b351906a680669615e4df762f8704cc3b0ba6a588a757e65b18c32f6a5e4f80091ac17496fcf2a59fbea45bfed8404
|
@@ -7,10 +7,10 @@ module MrujsRails
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def redirect_to(url = {}, options = {})
|
10
|
-
|
10
|
+
turbolinks = options.delete(:turbolinks)
|
11
11
|
|
12
12
|
super.tap do
|
13
|
-
if request.xhr? && !request.get?
|
13
|
+
if turbolinks != false && request.xhr? && !request.get?
|
14
14
|
visit_location_with_turbolinks(location, turbolinks)
|
15
15
|
elsif request.headers["Turbolinks-Referrer"]
|
16
16
|
store_turbolinks_location_in_session(location)
|
@@ -24,10 +24,10 @@ module MrujsRails
|
|
24
24
|
action = action.to_s
|
25
25
|
visit_action = action == "advance" ? action : "replace"
|
26
26
|
|
27
|
+
response.set_header("X-Xhr-Redirect", location)
|
28
|
+
response.set_header("TURBOLINKS-REDIRECT-ACTION", visit_action)
|
29
|
+
response.set_header("TURBOLINKS-REDIRECT-LOCATION", location)
|
27
30
|
response.content_type = Mime[:turbolinks]
|
28
|
-
response.headers["X-Xhr-Redirect"] = location
|
29
|
-
response.headers["TURBOLINKS-REDIRECT-ACTION"] = visit_action
|
30
|
-
response.headers["TURBOLINKS-REDIRECT-LOCATION"] = location
|
31
31
|
end
|
32
32
|
|
33
33
|
def store_turbolinks_location_in_session(location)
|
@@ -35,9 +35,9 @@ module MrujsRails
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def set_turbolinks_location_header_from_session
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
return unless session && session[:_turbolinks_location]
|
39
|
+
|
40
|
+
response.set_header("Turbolinks-Location", session.delete(:_turbolinks_location))
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
data/lib/mrujs_rails/version.rb
CHANGED