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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5d36116330e9d9541821f72ac918ff58f7789f8
4
- data.tar.gz: 76b5685b4c31f24815ea85089b401a145f1b66a2
3
+ metadata.gz: bea11d6dd2b7bd3ff388bcd4660848af9f336121
4
+ data.tar.gz: 2f89a2437b24339ec9531963664abcb5e6695b11
5
5
  SHA512:
6
- metadata.gz: ac3ea299540fcddffc7e27740aad818b50890d5271d71e9302b376652f80829f7e5ea08a6bda78c0c19d03f6f12520e967e98bb99098179c67a15767ef653de7
7
- data.tar.gz: d764464549259fa71e3e193c2cbe50f83629cbaadfcd0533d080e080535d2c42ab29f4cd37d6134137389209c19eb8cf0afa912fc021421ffe7faadb3a2cce55
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
@@ -1,3 +1,3 @@
1
1
  module Conjoin
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
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.13
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-18 00:00:00.000000000 Z
11
+ date: 2014-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cuba