inertia_rails 1.8.0 → 1.9.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.
- checksums.yaml +4 -4
- data/.github/workflows/push.yml +1 -1
- data/Appraisals +4 -0
- data/CHANGELOG.md +4 -0
- data/gemfiles/rails_6.1.gemfile +7 -0
- data/lib/inertia_rails/controller.rb +17 -3
- data/lib/inertia_rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a3b7e29654788cf3c7ac7307d83fd258d47c7ee5daa36745998c944ae31b472
|
4
|
+
data.tar.gz: 4070f2fb9ae9d253a94c98d7f8705f713248788b63611bfa30f36edaaa15a73e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aa986d0e69a1db45d94ca921771e7ff82ec61c53008dbf756b9eed3728837d314ee773e12acd27a98fcb1372d67f44653fa749ef24b2959759849b2be925ae9
|
7
|
+
data.tar.gz: ab880524135f77d437aeb4c8dfa1e3e23ddc69db5d99a5adea6139d17331db7981f691921ae10b84d41122d06fc1a01a456af902ed3fcde704fb9d4bf1b9f08a
|
data/.github/workflows/push.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.9.0] - 2021-01-17
|
8
|
+
|
9
|
+
* Added the same inertia awareness that redirect_to has to redirect_back
|
10
|
+
|
7
11
|
## [1.8.0] - 2020-12-08
|
8
12
|
|
9
13
|
* Add `inertia` route helper feature
|
@@ -20,17 +20,31 @@ module InertiaRails
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
private
|
24
|
+
|
23
25
|
def inertia_location(url)
|
24
26
|
headers['X-Inertia-Location'] = url
|
25
27
|
head :conflict
|
26
28
|
end
|
27
29
|
|
28
30
|
def redirect_to(options = {}, response_options = {})
|
29
|
-
|
31
|
+
capture_inertia_errors(response_options)
|
32
|
+
super(options, response_options)
|
33
|
+
end
|
34
|
+
|
35
|
+
def redirect_back(fallback_location:, allow_other_host: true, **options)
|
36
|
+
capture_inertia_errors(options)
|
37
|
+
super(
|
38
|
+
fallback_location: fallback_location,
|
39
|
+
allow_other_host: allow_other_host,
|
40
|
+
**options,
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def capture_inertia_errors(options)
|
45
|
+
if (inertia_errors = options.dig(:inertia, :errors))
|
30
46
|
session[:inertia_errors] = inertia_errors
|
31
47
|
end
|
32
|
-
|
33
|
-
super(options, response_options)
|
34
48
|
end
|
35
49
|
end
|
36
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inertia_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Knoles
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-01-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- gemfiles/rails_5.1.gemfile
|
138
138
|
- gemfiles/rails_5.2.gemfile
|
139
139
|
- gemfiles/rails_6.0.gemfile
|
140
|
+
- gemfiles/rails_6.1.gemfile
|
140
141
|
- inertia_rails.gemspec
|
141
142
|
- lib/inertia_rails.rb
|
142
143
|
- lib/inertia_rails/controller.rb
|