active_admin-form_errors 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 9d917a0f34844c53959aaf1f3dbe9b3f68f8ebc4
4
- data.tar.gz: 0a2515b2e2f21f953c1237d7dfbef42e47f04848
3
+ metadata.gz: 9457934151e051a243afc3ba97e86e6f4c50782f
4
+ data.tar.gz: d3ee9dba74387d1546e6f651c1717b66b19161bb
5
5
  SHA512:
6
- metadata.gz: b1eea213925e91457e98c3231471da922494eb6e2f1f95ee42ac458d37c914c3b37ad1d96ddd1d4b737dcbb8b8ad18aa9eb63dd98f5a5b5bad884a56a158e8d2
7
- data.tar.gz: 91d7977bf3706a9b22c983d25619e5972e647b82570f0f0ad804de8fd4aaca4a12997bbce9f567ade382aac4a181159271e0bdaa7d12a6f6f6b2e96bd3957e45
6
+ metadata.gz: f7a633ff87f477360fd80b2aa7d79ce3f26e7db658d211516ed635c316bb9e3f2f4db3e8877bbf17049bf8ccae888c5c6bb261b610ded75290c779b03e543198
7
+ data.tar.gz: 4a29ee6a5d961e9ccc596247158246bdce8cc4e75d60276c1211b36aab93547c995ba3f9a69183c015f09edac9c7c5ba63d14add63f9ef6f98e4ccba8518f0eb
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # ActiveAdmin Form Errors
2
2
  Pretty form errors by default in your ActiveAdmin.
3
3
 
4
+ <img src="./demo.gif"/>
5
+
4
6
  ## Installation
5
7
  **1. Import gem**
6
8
  ```ruby
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 active_admin_config.form_errors == false
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 active_admin_config.form_errors.respond_to?(:call)
26
- instance_exec(&active_admin_config.form_errors)
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
@@ -3,7 +3,7 @@ module ActiveAdmin
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 0
6
+ PATCH = 1
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  end
9
9
  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.0
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-14 00:00:00.000000000 Z
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