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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d8d955fbddbe962a7033fc776c25ef83954f755847610f90cad2978cd81935d
4
- data.tar.gz: 9f86695adad081d1f65a1ba8b27f0a6cc7ccc4ea025e6bc857dfcf8493334ee2
3
+ metadata.gz: b23ad71e18cb8e0952208f2b6a10dab8b1b814d1b5cba39815da8f6bea1fb52a
4
+ data.tar.gz: 5b1173f9c287817b9465730a2ac061ca979131c2fb742c107bd86a9a7dc43d8e
5
5
  SHA512:
6
- metadata.gz: 017f96373ddc46c41111e8e901b85ef7f78bac687ef16f127296a44534c443ab47dea958321493227e4cfca787665550f4be4ddbc5683227e9d414f5d5842e51
7
- data.tar.gz: 70b21b20741ba26aba60ef5e0332ab2373fc44698b5c270ab726790ffff70672248f8c1b58ca25bce04305383354116a5d857c7a1a40b3674df3dc8bfd390cab
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
- # turbolinks = options.delete(:turbolinks)
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
- if session && session[:_turbolinks_location]
39
- response.headers["Turbolinks-Location"] = session.delete(:_turbolinks_location)
40
- end
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
@@ -1,3 +1,3 @@
1
1
  module MrujsRails
2
- VERSION = "0.1.0-beta.14"
2
+ VERSION = "0.1.0-beta.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrujs_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.beta.14
4
+ version: 0.1.0.pre.beta.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - ParamagicDev