active_admin-form_errors 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/demo.gif +0 -0
- data/lib/active_admin/form_errors/form.rb +7 -3
- data/lib/active_admin/form_errors/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9457934151e051a243afc3ba97e86e6f4c50782f
|
4
|
+
data.tar.gz: d3ee9dba74387d1546e6f651c1717b66b19161bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7a633ff87f477360fd80b2aa7d79ce3f26e7db658d211516ed635c316bb9e3f2f4db3e8877bbf17049bf8ccae888c5c6bb261b610ded75290c779b03e543198
|
7
|
+
data.tar.gz: 4a29ee6a5d961e9ccc596247158246bdce8cc4e75d60276c1211b36aab93547c995ba3f9a69183c015f09edac9c7c5ba63d14add63f9ef6f98e4ccba8518f0eb
|
data/README.md
CHANGED
data/demo.gif
ADDED
Binary file
|
@@ -3,7 +3,7 @@ module ActiveAdmin
|
|
3
3
|
module Form
|
4
4
|
def build(resource, options = {}, &block)
|
5
5
|
wrapped_block =
|
6
|
-
if
|
6
|
+
if !form_errors_config
|
7
7
|
block
|
8
8
|
elsif block_given?
|
9
9
|
proc do |f|
|
@@ -22,12 +22,16 @@ module ActiveAdmin
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def parse_resource_errors(resource)
|
25
|
-
if
|
26
|
-
instance_exec(&
|
25
|
+
if form_errors_config.respond_to?(:call)
|
26
|
+
instance_exec(&form_errors_config)
|
27
27
|
else
|
28
28
|
resource.errors.keys
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
def form_errors_config
|
33
|
+
respond_to?(:active_admin_config) ? active_admin_config.form_errors : ActiveAdmin.application.form_errors
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_admin-form_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dhyego Fernando
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- Rakefile
|
125
125
|
- active_admin-form_errors.gemspec
|
126
126
|
- app/assets/stylesheets/active_admin/form_errors.scss
|
127
|
+
- demo.gif
|
127
128
|
- lib/active_admin/form_errors.rb
|
128
129
|
- lib/active_admin/form_errors/engine.rb
|
129
130
|
- lib/active_admin/form_errors/form.rb
|