activeadmin-ajax_filter 0.3.2 → 0.3.3
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/README.md +11 -2
- data/app/assets/javascripts/activeadmin-ajax_filter.js.coffee +1 -1
- data/lib/active_admin/ajax_filter/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bc2b3bac1969b31954b1bae6a5c4068e180fd11
|
4
|
+
data.tar.gz: 0793f31ac698e16580752f3b2deae2c1ee108410
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48808be4a3e630bf35aa7a712832dc1cb8c2abea5cc998ee39afa111be190df9a683b8656f01204e749b0a8bc55cfb668849aae5094063290afc277309f6d5a3
|
7
|
+
data.tar.gz: 5223e7a7a51020539a6ab1fefa45de36e564aa97e59999fc36c53b6accdca29750ec438471111a5b6ba9926a3ee644ef233da63eeca4695bb0640c24207b1e95
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
activeadmin-ajax_filter (0.3.
|
4
|
+
activeadmin-ajax_filter (0.3.3)
|
5
5
|
activeadmin (>= 1.0.0.pre1)
|
6
6
|
coffee-rails (>= 4.1.0)
|
7
7
|
selectize-rails (>= 0.11.2)
|
@@ -82,7 +82,7 @@ GEM
|
|
82
82
|
coffee-script-source
|
83
83
|
execjs
|
84
84
|
coffee-script-source (1.10.0)
|
85
|
-
concurrent-ruby (1.0.
|
85
|
+
concurrent-ruby (1.0.2)
|
86
86
|
database_cleaner (1.5.3)
|
87
87
|
diff-lcs (1.2.5)
|
88
88
|
docile (1.1.5)
|
data/README.md
CHANGED
@@ -64,7 +64,11 @@ end
|
|
64
64
|
# Main resource
|
65
65
|
# As a filter
|
66
66
|
ActiveAdmin.register Invoice do
|
67
|
-
filter :user, as: :ajax_select, data: {
|
67
|
+
filter :user, as: :ajax_select, data: {
|
68
|
+
url: '/admin/users/filter',
|
69
|
+
search_fields: [:email, :customer_uid],
|
70
|
+
limit: 7,
|
71
|
+
}
|
68
72
|
# ...
|
69
73
|
end
|
70
74
|
|
@@ -72,7 +76,12 @@ end
|
|
72
76
|
ActiveAdmin.register Invoice do
|
73
77
|
form do |f|
|
74
78
|
f.input :language # used by ajax_search_fields
|
75
|
-
f.input :user, as: :ajax_select, data: {
|
79
|
+
f.input :user, as: :ajax_select, data: {
|
80
|
+
url: '/admin/users/filter',
|
81
|
+
search_fields: [:name],
|
82
|
+
static_ransack: { active_eq: true },
|
83
|
+
ajax_search_fields: [:language_id],
|
84
|
+
}
|
76
85
|
# ...
|
77
86
|
end
|
78
87
|
end
|
@@ -36,7 +36,7 @@ $ ->
|
|
36
36
|
input = relatedInput(field)
|
37
37
|
if input.length
|
38
38
|
(input.data('ajax-search-fields') or '').split(' ').some (ajaxField) ->
|
39
|
-
relatedInput(ajaxField).attr('id') == initial_input_id
|
39
|
+
ajaxField.length > 0 && relatedInput(ajaxField).attr('id') == initial_input_id
|
40
40
|
|
41
41
|
select.selectize
|
42
42
|
valueField: valueField
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-ajax_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Emelyanov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -307,4 +307,3 @@ signing_key:
|
|
307
307
|
specification_version: 4
|
308
308
|
summary: AJAX filters for ActiveAdmin
|
309
309
|
test_files: []
|
310
|
-
has_rdoc:
|