formify 0.23.7 → 0.23.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/formify/controller_helpers.rb +10 -6
- data/lib/formify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 015ab62d01b20c23212fe36b9888938af1a107990dd29ba1ae39fd66947b2d8e
|
4
|
+
data.tar.gz: 8f65bd50586e9361b4ef45125f040616f2de8d0996d2c5d406b8c548544d939f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53deab0c2b64cc4b1acf1ad3279c0e3043cdbccbd0125e938a59f123017a2f2c375cc496e6d9dcc0d62b4c7bd1ece37260c20548cce30abf72c76de1c4ec48da
|
7
|
+
data.tar.gz: 0a3806cbd9c870c33d5e88ac8063e79b320e0db4ce5b502e6cfc7b454b6a3e7e81af20175627818fe9f115d5168204ac8aba0f3009357da27104949842692213
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
formify (0.23.
|
4
|
+
formify (0.23.8)
|
5
5
|
rails
|
6
6
|
resonad
|
7
7
|
with_advisory_lock
|
@@ -157,7 +157,7 @@ GEM
|
|
157
157
|
thor (0.20.3)
|
158
158
|
thread_safe (0.3.6)
|
159
159
|
tins (1.20.3)
|
160
|
-
tzinfo (1.2.
|
160
|
+
tzinfo (1.2.7)
|
161
161
|
thread_safe (~> 0.1)
|
162
162
|
websocket-driver (0.7.1)
|
163
163
|
websocket-extensions (>= 0.1.0)
|
@@ -5,6 +5,10 @@ module Formify
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
+
def formify_flash_keys
|
9
|
+
@formify_flash_keys ||= %i[danger info success]
|
10
|
+
end
|
11
|
+
|
8
12
|
def formify_params(root, *permitted)
|
9
13
|
params
|
10
14
|
.permit(
|
@@ -12,17 +16,17 @@ module Formify
|
|
12
16
|
)[root]
|
13
17
|
end
|
14
18
|
|
15
|
-
def
|
16
|
-
keywords.slice(
|
19
|
+
def formify_redirect_to_with_flash(*args, **keywords)
|
20
|
+
keywords.slice(flash_keys).each do |k, v|
|
17
21
|
flash[k] = v
|
18
22
|
end
|
19
23
|
|
20
24
|
Rails.logger.info "Redirecting to: #{args.first}"
|
21
25
|
|
22
|
-
|
26
|
+
redirect_to(*args, **keywords.except(formify_flash_keys))
|
23
27
|
end
|
24
28
|
|
25
|
-
def
|
29
|
+
def formify_render_form_result(form:, on_failure: nil, on_success: nil, result:)
|
26
30
|
if result.success?
|
27
31
|
if form.translation_success.present?
|
28
32
|
flash[:success] = form.translation_success
|
@@ -39,8 +43,8 @@ module Formify
|
|
39
43
|
yield(result) if block_given?
|
40
44
|
end
|
41
45
|
|
42
|
-
def
|
43
|
-
|
46
|
+
def formify_save_and_render_form(form:, on_failure: nil, on_success: nil, &block)
|
47
|
+
formify_render_form_result(
|
44
48
|
form: form,
|
45
49
|
on_failure: on_failure,
|
46
50
|
on_success: on_success,
|
data/lib/formify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Jackson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|