bs_form_builder 0.1.0 → 0.1.1
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: cbdf79b579803ea0f7c6e9c53ebeac00c918ac3c
|
4
|
+
data.tar.gz: 391ab911f9a6f3cd3469376c4da29615c8092596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ab1a7fc7568e23b34a9a9019fc7ea1ac2b065a389a7e3dcb8f87afa16c05f754f490bde567f59a781cb904eef6cbc5243f7f8302e8d0f4cc8993a87a6b5972
|
7
|
+
data.tar.gz: edb6f3c3c52b2cd5fed50a31c0f6d9cfd0dd60146b287a6f9a21f812622210f0094f2ec86dcbabcdc405b76216b087facc3b4caa23bb92e0bac92865960b3ca6
|
@@ -50,12 +50,22 @@ class BootstrapFormBuilder::HorizontalFormBuilder < ActionView::Helpers::FormBui
|
|
50
50
|
|
51
51
|
def check_box(name, opts = {})
|
52
52
|
form_group(name, opts.slice(:label_options, :group_options, :tip_options)) do
|
53
|
-
|
54
|
-
@template.content_tag(:label, super(name, opts) + (help(name) || " ").html_safe),
|
55
|
-
:class => 'checkbox')
|
53
|
+
simple_check_box(name, opts)
|
56
54
|
end
|
57
55
|
end
|
58
56
|
|
57
|
+
# A checkbox without the form group and control label
|
58
|
+
def simple_check_box(name, options = {}, checked_value = '1', unchecked_value = '0')
|
59
|
+
@template.content_tag(:div,
|
60
|
+
@template.content_tag(:label,
|
61
|
+
@template.check_box(@object_name, name,
|
62
|
+
objectify_options(options),
|
63
|
+
checked_value,
|
64
|
+
unchecked_value) +
|
65
|
+
label_text(name).html_safe),
|
66
|
+
:class => 'checkbox')
|
67
|
+
end
|
68
|
+
|
59
69
|
# uses bootstrap option to stretch the buttons to the full enclosing width
|
60
70
|
# if you use this, you may need to add the following style to your
|
61
71
|
# stylesheet to re-hide the radio-button circle
|
@@ -158,6 +168,10 @@ class BootstrapFormBuilder::HorizontalFormBuilder < ActionView::Helpers::FormBui
|
|
158
168
|
end
|
159
169
|
end
|
160
170
|
|
171
|
+
def label_text(name)
|
172
|
+
I18n.t("helpers.label.#{object_name}.#{name}", :default => "")
|
173
|
+
end
|
174
|
+
|
161
175
|
def tip(name, options = {})
|
162
176
|
i18n_name = "helpers.tips.#{object_name}.#{name}"
|
163
177
|
if I18n.exists?(i18n_name)
|