activeadmin_selectize 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 67f51638f236de90ef8fafc38b0bbe0ed8b9597c
4
- data.tar.gz: 14f578d393f4889cf25c0ffdf096163899337d65
3
+ metadata.gz: d3a61a8c9ec00cdabdd940c905360d58fd5621bf
4
+ data.tar.gz: 4f2202a52a27293e7486924c5fee9c2cc02023e0
5
5
  SHA512:
6
- metadata.gz: 7eff3c556c2db4eee3e6e294ef0a4513656ad8ac4226193c4b694857f79a93a1f50cf7feb67a06f9c6bab468a60fdc4f8a039a885ad180cea24669d9ae1d6747
7
- data.tar.gz: 72f6eaf2a6d0c7626915ee6116df4b8c39073b2c04ffed195a082be1225954a6b48c068183f6d43b766416b249635492053ac081b10585cb02cc098c587cd49d
6
+ metadata.gz: dc89542066d7716d13db44fa67421e1e2c1168c82bdf98bce104b098e3d2157b28dd28e7c1b138fc30d4fdb9fbdaac0d7e24a7056032ddda9b9ddc961c280869
7
+ data.tar.gz: 521326d5a96cf23c3d82331dafca7df7a5036ff74198b8c14d1aa4c0eaf8faa541fc3a17676d0a154869632c7b33e78ff4ffac7560a7df53e11594c971b20faa
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Mark Fariburn, Praxitar Ltd
1
+ Copyright (c) 2017 Mattia Roccoberton
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -25,6 +25,18 @@ Features:
25
25
 
26
26
  Why 2 separated scripts? In this way you can include a different version of Selectize.js if you like.
27
27
 
28
+ ## Notes
29
+
30
+ - In ActiveAdmin json routes should be enabled by default, this behavior is controlled by *download_links* option for index action. Example:
31
+
32
+ ```rb
33
+ index download_links: [:csv, :json] do
34
+ # ...
35
+ end
36
+ ```
37
+
38
+ - If the select items "gets cut" by the container try adding: `'data-opts': '{"dropdownParent":"body"}'`
39
+
28
40
  ## Example
29
41
 
30
42
  Example 1: an Article model with a many-to-many relation with Tag model:
@@ -49,6 +61,15 @@ end
49
61
  end
50
62
  ```
51
63
 
64
+ Example 2: using selectize in filters:
65
+
66
+ ```ruby
67
+ # Without remote items (no AJAX):
68
+ filter :name_eq, as: :selectize, collection: Author.all.pluck( :name, :name )
69
+ # With remote items:
70
+ filter :tags_id_eq, as: :selectize, collection: [], input_html: { 'data-opt-remote': '/admin/tags.json', 'data-opt-text': 'name', 'data-opt-value': 'id', 'data-opts': '{"dropdownParent":"body"}', placeholder: 'Search a tag...' }
71
+ ```
72
+
52
73
  ## Options
53
74
 
54
75
  Pass the required options using `input_html`.
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module Selectize
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
@@ -4,7 +4,9 @@ module Formtastic
4
4
  include Formtastic::Inputs::Base
5
5
 
6
6
  def input_html_options
7
- super.merge( class: 'selectized' )
7
+ opts = super
8
+ opts[:class] = opts[:class].blank? ? 'selectized' : ( opts[:class] + ' selectized' )
9
+ opts
8
10
  end
9
11
 
10
12
  # def collection
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_selectize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-30 00:00:00.000000000 Z
11
+ date: 2017-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  version: '0'
71
71
  requirements: []
72
72
  rubyforge_project:
73
- rubygems_version: 2.5.2
73
+ rubygems_version: 2.6.13
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Selectize for ActiveAdmin