Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use control-group style instead of clearfix for form elements to prop…

…erly render error conditions
  • Loading branch information...
commit d74d5adcbb8d2c78466e949989f481ff8628f64b 1 parent b581853
@tadman tadman authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/twitter_bootstrap_form_for/form_builder.rb
View
8 lib/twitter_bootstrap_form_for/form_builder.rb
@@ -39,7 +39,7 @@ def inputs(legend = nil, options = {}, &block)
# inside of here, and will not look correct unless they are.
#
def toggles(label = nil, &block)
- template.content_tag(:div, :class => 'clearfix') do
+ template.content_tag(:div, :class => 'control-group') do
template.concat template.content_tag(:label, label)
template.concat template.content_tag(:div, :class => "input") {
template.content_tag(:ul, :class => "inputs-list") { block.call }
@@ -69,7 +69,7 @@ def submit(value = nil, options = {})
# to the supplied block.
#
def inline(label = nil, &block)
- template.content_tag(:div, :class => 'clearfix') do
+ template.content_tag(:div, :class => 'control-group') do
template.concat template.content_tag(:label, label) if label.present?
template.concat template.content_tag(:div, :class => 'input') {
template.content_tag(:div, :class => 'inline-inputs') do
@@ -115,7 +115,7 @@ def inline(label = nil, &block)
template.concat template.content_tag(:span, label)
}
if toggle == :check_box
- template.concat template.content_tag(:div, :class => "clearfix error") {
+ template.concat template.content_tag(:div, :class => "control-group error") {
template.concat error_span(attribute)
} if errors_on?(attribute)
end
@@ -132,7 +132,7 @@ def inline(label = nil, &block)
#
def div_wrapper(attribute, options = {}, &block)
options[:id] = _wrapper_id attribute, options[:id]
- options[:class] = _wrapper_classes attribute, options[:class], 'clearfix'
+ options[:class] = _wrapper_classes attribute, options[:class], 'control-group'
template.content_tag :div, options, &block
end
Please sign in to comment.
Something went wrong with that request. Please try again.