Permalink
Browse files

Removes generation of the class "control-label".

This is work to support Bootstrap 3. In this version the "control-label"
is dropped.  We no longer create it and change the name of the methods
to reflect this change.
  • Loading branch information...
1 parent 2b74b90 commit 19e7b25eeed1768afd4b49210cf96fd212fee4c0 @mjbellantoni committed Nov 24, 2013
View
15 lib/formtastic-bootstrap/inputs/base/labelling.rb
@@ -7,20 +7,15 @@ module Labelling
def label_html_options
super.tap do |options|
- # Bootstrap defines class 'label'
+ # Bootstrap defines class 'label' too, so remove the
+ # one that gets created by Formtastic.
options[:class] = options[:class].reject { |c| c == 'label' }
- # options[:class] << "control-label"
end
end
- def control_label_html_options
- label_html_options.tap do |options|
- options[:class] << "control-label"
- end
- end
-
- def control_label_html
- render_label? ? builder.label(input_name, label_text, control_label_html_options) : "".html_safe
+ # def control_label_html
+ def label_html
+ render_label? ? builder.label(input_name, label_text, label_html_options) : "".html_safe
end
end
View
2 lib/formtastic-bootstrap/inputs/base/timeish.rb
@@ -5,7 +5,7 @@ module Timeish
def to_html
form_group_wrapping do
- control_label_html <<
+ label_html <<
controls_wrapping do
hidden_fragments <<
fragments.map do |fragment|
View
2 lib/formtastic-bootstrap/inputs/base/wrapping.rb
@@ -16,7 +16,7 @@ def bootstrap_wrapping(&block)
].compact.join("\n").html_safe
form_group_wrapping do
- control_label_html <<
+ label_html <<
controls_wrapping do
if prepended_or_appended?(options)
template.content_tag(:div, :class => add_on_wrapper_classes(options).join(" ")) do
View
2 lib/formtastic-bootstrap/inputs/boolean_input.rb
@@ -6,7 +6,7 @@ class BooleanInput < Formtastic::Inputs::BooleanInput
def to_html
form_group_wrapping do
- (options[:label_outside] ? control_label_html : "".html_safe) <<
+ (options[:label_outside] ? label_html : "".html_safe) <<
hidden_field_html <<
controls_wrapping do
[label_with_nested_checkbox, hint_html].join("\n").html_safe
View
2 lib/formtastic-bootstrap/inputs/check_boxes_input.rb
@@ -9,7 +9,7 @@ class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput
def to_html
form_group_wrapping do
- control_label_html <<
+ label_html <<
hidden_field_for_all <<
controls_wrapping do
collection.map { |choice|
View
2 lib/formtastic-bootstrap/inputs/radio_input.rb
@@ -9,7 +9,7 @@ class RadioInput < Formtastic::Inputs::RadioInput
def to_html
form_group_wrapping do
- control_label_html <<
+ label_html <<
controls_wrapping do
collection.map { |choice|
choice_html(choice)

0 comments on commit 19e7b25

Please sign in to comment.