sinatra-tag-helpers 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/sinatra/tag-helpers/version.rb +1 -1
- data/lib/sinatra/tag-helpers.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjhkNDNjMTczZjU0ZWU5YmE0Y2FkNTU5YWU0MTI5MWYyNTI5OTdiNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzNkM2NhNjdkMTZhZmRiMWNkNDNlNTRhN2Y3NDM1ZDVkZDA2M2VjYQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjMzMDVlZGIyYWZmMTZhMmEwNjgzYjZkODc5MzI1ODM5ZWNkNDdkMTM5M2Vh
|
10
|
+
NTI0NjAwNDI4ZDVkMjcwZTA4ZGY4Y2RlN2JkMTRiYTE0YjA3Njk4NjlkYWM5
|
11
|
+
MjdjOTUxZGU4YzM0MmVmMDA2YmE5Y2YyMjg4MDE1YTIwMmE5Yjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzQwMzY0M2I3Njc4Yjc4MGY5MWMxZGVmN2ExMjVjZDlkODg4ZmYyZGVjZmY1
|
14
|
+
YmFhOWMzMTQ5ZWY4ZDQ4YTdiZDYxZTg3Y2Y1ZmRlYzU2ZGVhMjIyMjRjNDYw
|
15
|
+
MGI4Y2ZkMmI2MzIxYjdmMjhjMDU2MWY3MmQzY2Q0YzdhZjgyNjA=
|
data/lib/sinatra/tag-helpers.rb
CHANGED
@@ -163,7 +163,18 @@ module Sinatra
|
|
163
163
|
select = ["<select #{ to_attributes(attributes) }>"]
|
164
164
|
|
165
165
|
options.collect do |key, val|
|
166
|
-
|
166
|
+
# groups...
|
167
|
+
if val.is_a?(Hash)
|
168
|
+
select.push "<optgroup label='#{ key }'>"
|
169
|
+
|
170
|
+
val.each do |group_key, group_val|
|
171
|
+
select.push option_for(param, :key => group_key, :value => group_val, :default => attributes[:default])
|
172
|
+
end
|
173
|
+
|
174
|
+
select.push "</optgroup>"
|
175
|
+
else
|
176
|
+
select.push option_for(param, :key => key, :value => val, :default => attributes[:default])
|
177
|
+
end
|
167
178
|
end
|
168
179
|
|
169
180
|
select.push('</select>').join(' ').chomp
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-tag-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Lecklider
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|