conjoin 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/conjoin/inputs/select.rb +6 -1
- data/lib/conjoin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bea11d6dd2b7bd3ff388bcd4660848af9f336121
|
4
|
+
data.tar.gz: 2f89a2437b24339ec9531963664abcb5e6695b11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37a7cfcaf55b441eed330028e51354ebeab65edab9f8c4dffbcc65009c688ab3a3cb56dcbb1972066379ed6f6c93f6f43e4d74a9e6b25be2c35a26a2d3bc7034
|
7
|
+
data.tar.gz: b3499636bfe7b1a4da814e902594c858fe4f2e660d5757cb624e98863d5a0859ea6204507057fd066b97cdcd88bcc8f425bed32c8e9c070d6f2150ab315e2751
|
@@ -3,11 +3,14 @@ module Conjoin
|
|
3
3
|
class SelectInput < Input
|
4
4
|
def display
|
5
5
|
append_button = options.delete :append_button
|
6
|
+
if options[:multiple]
|
7
|
+
options[:name] += '[]'
|
8
|
+
end
|
6
9
|
|
7
10
|
content = mab do
|
8
11
|
# automatically add a prompt by default
|
9
12
|
options[:prompt] = 'true' unless options.key? :prompt
|
10
|
-
options[:class] += ' selectize'
|
13
|
+
options[:class] += ' selectize' unless options.delete(:selectize) == false
|
11
14
|
selected_value = options.delete :value
|
12
15
|
|
13
16
|
select options do
|
@@ -64,6 +67,8 @@ module Conjoin
|
|
64
67
|
}
|
65
68
|
if selected_value.is_a? ActiveRecord::Associations::CollectionProxy
|
66
69
|
opts['selected'] = 'selected' if selected_value.map(&:id).include? value
|
70
|
+
elsif selected_value.is_a? Array
|
71
|
+
opts['selected'] = 'selected' if selected_value.include? value.to_s
|
67
72
|
else
|
68
73
|
opts['selected'] = 'selected' if selected_value.to_s == value.to_s
|
69
74
|
end
|
data/lib/conjoin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjoin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cuba
|