Permalink
Browse files

Removes the controls_wrapping method.

This is work to support Bootstrap 3.  Remove the controls_wrapping
method as Bootstrap 3 eliminates this entirely.
  • Loading branch information...
mjbellantoni committed Nov 24, 2013
1 parent 19e7b25 commit b5eec28598fd2f0047d3805744e4681de6b4c202
@@ -6,12 +6,10 @@ module Timeish
def to_html
form_group_wrapping do
label_html <<
- controls_wrapping do
- hidden_fragments <<
- fragments.map do |fragment|
- fragment_input_html(fragment.to_sym)
- end.join.html_safe
- end
+ hidden_fragments <<
+ fragments.map do |fragment|
+ fragment_input_html(fragment.to_sym)
+ end.join.html_safe
end
end
@@ -17,14 +17,12 @@ def bootstrap_wrapping(&block)
form_group_wrapping do
label_html <<
- controls_wrapping do
- if prepended_or_appended?(options)
- template.content_tag(:div, :class => add_on_wrapper_classes(options).join(" ")) do
- input_content
- end
- else
+ if prepended_or_appended?(options)
+ template.content_tag(:div, :class => add_on_wrapper_classes(options).join(" ")) do
input_content
end
+ else
+ input_content
end
end
end
@@ -45,31 +43,18 @@ def form_group_wrapping(&block)
)
end
- def controls_wrapping(&block)
- template.content_tag(:div,
- [template.capture(&block), error_html].join("\n").html_safe,
- controls_wrapper_html_options
- )
- end
-
- def controls_wrapper_html_options
- {
- :class => "controls"
- }
- end
-
def wrapper_html_options
super.tap do |options|
options[:class] << " form-group"
end
end
-
def add_on_wrapper_classes(options)
[:prepend, :append, :prepend_content, :append_content].map do |key|
"input-#{key.to_s.gsub('_content', '')}" if options[key]
end
end
+
end
end
end
@@ -8,9 +8,7 @@ def to_html
form_group_wrapping do
(options[:label_outside] ? label_html : "".html_safe) <<
hidden_field_html <<
- controls_wrapping do
- [label_with_nested_checkbox, hint_html].join("\n").html_safe
- end
+ [label_with_nested_checkbox, hint_html].join("\n").html_safe
end
end
@@ -11,11 +11,9 @@ def to_html
form_group_wrapping do
label_html <<
hidden_field_for_all <<
- controls_wrapping do
- collection.map { |choice|
- choice_html(choice)
- }.join("\n").html_safe
- end
+ collection.map { |choice|
+ choice_html(choice)
+ }.join("\n").html_safe
end
end
@@ -10,11 +10,9 @@ class RadioInput < Formtastic::Inputs::RadioInput
def to_html
form_group_wrapping do
label_html <<
- controls_wrapping do
- collection.map { |choice|
- choice_html(choice)
- }.join("\n").html_safe
- end
+ collection.map { |choice|
+ choice_html(choice)
+ }.join("\n").html_safe
end
end

0 comments on commit b5eec28

Please sign in to comment.