administrate-field-has_many_search 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30c3aefe8f00ff3ebe668a8db5e0f00b034a1f15f36df7617e124de6726335dc
|
4
|
+
data.tar.gz: 7a0572c85d1625f27276e2abaf3868e2e4d52b072a2ee2998240cf5adbb6ed72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f41eed366f391b58cea8d5c6c5ee2d95b5c00c71856e9ef570089371a154db23f03081882bc74495f423cc122530e7ba7c676c2fe08a306783a641aa2b135073
|
7
|
+
data.tar.gz: 10c5e7a51e0533971787857d1a40f06ee1b963b5f6be00a1480cfbfd4be00ba247da77d7a231ecea95fb8d95a2637bdec74bbc40946417c7963c6c7ca15cded0
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = 'administrate-field-has_many_search'
|
6
|
-
gem.version = '0.
|
6
|
+
gem.version = '0.2.0'.freeze
|
7
7
|
gem.authors = ['Klas Eskilson', 'Andrej Antas']
|
8
8
|
gem.email = ['klas.eskilson@gmail.com', 'andrej@antas.cz']
|
9
9
|
gem.homepage = 'https://github.com/redrick/administrate-field-has_many_search'
|
@@ -8,12 +8,14 @@ $(function() {
|
|
8
8
|
searchField: 'dashboard_display_name',
|
9
9
|
create: false,
|
10
10
|
searchUrl: $element.data('url') + '?search=',
|
11
|
+
limitPerPage: $element.data('limit'),
|
11
12
|
|
12
13
|
load: function(query, callback) {
|
13
14
|
if (!query.length) return callback();
|
14
15
|
var searchUrl = this.settings.searchUrl;
|
16
|
+
var limit = this.settings.limitPerPage;
|
15
17
|
$.ajax({
|
16
|
-
url: searchUrl + encodeURIComponent(query),
|
18
|
+
url: searchUrl + encodeURIComponent(query) + '&per_page=' + encodeURIComponent(limit),
|
17
19
|
type: 'GET',
|
18
20
|
error: function() {
|
19
21
|
callback();
|
@@ -22,7 +22,8 @@ that displays all possible records to associate with.
|
|
22
22
|
nil,
|
23
23
|
{},
|
24
24
|
multiple: true,
|
25
|
-
'data-url': polymorphic_url([namespace, field.associated_class], format: :json)
|
25
|
+
'data-url': polymorphic_url([namespace, field.associated_class], format: :json),
|
26
|
+
'data-limit': field.limit) do %>
|
26
27
|
<%= options_for_select(field.associated_resource_options, field.selected_options) %>
|
27
28
|
<% end %>
|
28
29
|
</div>
|