twitter_bootstrap_combo 0.0.6 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565d31a0e27657ae1b0c12f0f7267ebe43fc1b06
|
4
|
+
data.tar.gz: e659f9d58de61b31e3de330dbe6f7ca0d0eec7a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74697dc2f50c0678901990d6b42796c09468ad8de3cdbcdaf4943e315b6765f7cf0345421b7ecf687689ec9fffbac4880d028f8f65505e00be93f3d0e615879e
|
7
|
+
data.tar.gz: bbe37ce0afc7d5a1ee55d6d3e3f7fe5ff4fd7f4b9fe2bad6b4836dad0fb61b4b499e0187d4bbf4943614744e8008870967505e71ae8a3c00786ebf2a055b8c93
|
@@ -7,15 +7,17 @@ module TwitterBootstrapCombo
|
|
7
7
|
|
8
8
|
container.map do |element|
|
9
9
|
if Array === element then
|
10
|
-
text, value = element
|
10
|
+
text, value, options = element
|
11
11
|
else
|
12
12
|
text, value = element, element
|
13
13
|
end
|
14
|
-
|
14
|
+
options ||= {}
|
15
|
+
options[:class] ||= ''
|
15
16
|
if selected == value then
|
16
|
-
|
17
|
+
options[:class] += ' active'
|
17
18
|
end
|
18
|
-
|
19
|
+
options.reject! { |k,v| v.empty? }
|
20
|
+
content_tag(:li, options) do
|
19
21
|
link_to(text, '#', :class => "combo_box_item", :data => { :value => value })
|
20
22
|
end
|
21
23
|
end.join().html_safe
|