twitter-bootstrap-form-builder 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -33,7 +33,7 @@ module MNE
|
|
33
33
|
return super(field, *args) if label_tag === false
|
34
34
|
|
35
35
|
# create a help-block if present
|
36
|
-
help_block = opts[:help_block] ? @template.content_tag(:p, opts
|
36
|
+
help_block = opts[:help_block] ? @template.content_tag(:p, opts.delete(:help_block), :class => "help-block") : ""
|
37
37
|
|
38
38
|
# propogate properties of control group up
|
39
39
|
control_group_opts = opts[:control_group] || {}
|
@@ -61,15 +61,17 @@ module MNE
|
|
61
61
|
control_group(field, control_group_opts) do
|
62
62
|
label_tag + @template.content_tag(:div, :class => "controls") do
|
63
63
|
|
64
|
-
|
64
|
+
opts = options.clone
|
65
|
+
opts[:text] = nil
|
66
|
+
check_box_tag = super(field, opts, checked_value, unchecked_value).html_safe
|
65
67
|
|
66
|
-
|
67
|
-
check_box_tag
|
68
|
+
text_tag = build_label_tag(field, options, :text, {:class => "checkbox"}) do |opts|
|
69
|
+
"#{check_box_tag} #{opts[0]}".html_safe
|
68
70
|
end
|
69
71
|
|
70
|
-
|
72
|
+
text_tag ||= @template.content_tag(:label, check_box_tag, :class => "checkbox")
|
71
73
|
|
72
|
-
|
74
|
+
text_tag.html_safe + errors_for(field)
|
73
75
|
end.html_safe
|
74
76
|
end.html_safe
|
75
77
|
end
|