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: 9e5a699068fe8d5f017ca36b723813241ed8033046c4324fda887978702841d2
4
- data.tar.gz: 8d9bcb27f7f35be527c14534f94bf6bf31df444acfe1ac4838027425540cfc8f
3
+ metadata.gz: 30c3aefe8f00ff3ebe668a8db5e0f00b034a1f15f36df7617e124de6726335dc
4
+ data.tar.gz: 7a0572c85d1625f27276e2abaf3868e2e4d52b072a2ee2998240cf5adbb6ed72
5
5
  SHA512:
6
- metadata.gz: d4a8b0ef760d8b84902714733ee9560a9b883914d8fcf96a80481c6122236e045b7e292b87e2803e28e94e878d7a84ebe0da5d68b1c56d83bb1eaf4a3f2c4bd5
7
- data.tar.gz: 0c18bd52a87f50b35fa1e8e1c7ecdb710bd892129a231fef133ffff306ed728c7993f9b15bfb93a2967aca7d779d3e135f5ea4de78e07c8d9d212c0a627e8582
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.1.0'.freeze
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)) do %>
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>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-has_many_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klas Eskilson