activeadmin_select_many 0.2.2 → 0.2.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: 7542c90490f2781e2091e54c43684e969039bb3a
4
- data.tar.gz: 8707be738dc243eca090ed17624a3d11bb1492ea
3
+ metadata.gz: f52caa2a1d61db342c777d0916d40fcc0d4a99a6
4
+ data.tar.gz: a6a6111dcca00954075be6e914e6c274c56e219f
5
5
  SHA512:
6
- metadata.gz: 5f36c599c3c0ed7e8a6200fe17bc6844abce252078c1b5ca09d4a97d4c7b789972d81feb97d70307f26d51f20c541e737e21eaff9d2604c4a5d32df8a7dd3396
7
- data.tar.gz: 1ed71c037e71efbb65a65decbc3318dc103ed7b3927c9b38de46e84394eba07f25ca9a897eab2f5c8a5971fc55c0c15fcada3d3a2b24b353f531e76d39be3524
6
+ metadata.gz: c0a062c899ff3b0b39ceb6070c2479e722696a95bd8d9d3ea92b8a23968a2445c9f6db74413d50e69635cc15937989892a4bba9c959b7fb7708f95276a0cc83c
7
+ data.tar.gz: 90599fe425f00b460048b4087a03491d1f7bec7fdb0c4967cd5092fe96751f77502264c86cbe61e2bd158561f7daa631a7113709f4e94cabe16e92af3c8d045f
data/README.md CHANGED
@@ -40,6 +40,7 @@ Features for *select_one*:
40
40
  - **placeholder**: placeholder string for search box
41
41
  - **remote_collection**: JSON path
42
42
  - **search_param**: parameter to use as search key (ransack format)
43
+ - **selected**: force value selection (array for *select_many*, single value for *select_one*)
43
44
  - **size**: number of rows of both the selects (default: 4)
44
45
  - **sortable**: set to true to enable sortable buttons (default: not set)
45
46
 
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module SelectMany
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.4'
4
4
  end
5
5
  end
@@ -58,7 +58,7 @@ module Formtastic
58
58
  end
59
59
 
60
60
  def select_dst_html
61
- selected = object.send( input_name )
61
+ selected = options[:selected] ? options[:selected] : object.send( input_name )
62
62
  selected = [selected] if selected.is_a? Fixnum
63
63
  coll = selected ? collection.select { |option| selected.include?( option[1] ) } : collection
64
64
  opts = input_options.merge( name: nil, id: nil, multiple: true, 'data-select': 'dst', size: options[:size] ? options[:size] : 4 )
@@ -32,7 +32,7 @@ module Formtastic
32
32
  end
33
33
 
34
34
  def select_html
35
- selected = object.send( input_name )
35
+ selected = options[:selected] ? options[:selected] : object.send( input_name )
36
36
  sel = ''
37
37
  collection.each do |item|
38
38
  if item[1] == selected
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_select_many
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.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-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin