formidable 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/formidable/elements.rb +10 -0
- data/lib/formidable/renderers/string.rb +1 -1
- data/lib/formidable/version.rb +1 -1
- metadata +2 -2
data/lib/formidable/elements.rb
CHANGED
@@ -188,6 +188,16 @@ module Formidable
|
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
191
|
+
class CheckBox < Input
|
192
|
+
ElementList.register(self, :check_box)
|
193
|
+
|
194
|
+
def initialize(name, attributes = Hash.new, raw_data = nil)
|
195
|
+
super(name, attributes.merge!(type: "checkbox"), raw_data)
|
196
|
+
end
|
197
|
+
|
198
|
+
renderer Renderers::LabeledInputRenderer
|
199
|
+
end
|
200
|
+
|
191
201
|
class Submit < Input
|
192
202
|
ElementList.register(self, :submit)
|
193
203
|
|
@@ -57,7 +57,7 @@ module Formidable
|
|
57
57
|
module LabeledElementMixin
|
58
58
|
def render
|
59
59
|
id = element.attributes[:id] || (element.attributes[:id] = "random-#{element.object_id}")
|
60
|
-
buffer = tag(:label, for: id) { element.attributes[:title] || element.attributes[:placeholder] } + "\n"
|
60
|
+
buffer = tag(:label, for: id) { element.attributes[:label] || element.attributes[:title] || element.attributes[:placeholder] } + "\n"
|
61
61
|
buffer + super
|
62
62
|
end
|
63
63
|
end
|
data/lib/formidable/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: formidable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jakub Stastny aka Botanicus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain:
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-16 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|