diff --git a/README.md b/README.md index dce289ccf..81d5ab983 100644 --- a/README.md +++ b/README.md @@ -526,7 +526,7 @@ div (field_with_errors), but this behavior is suppressed. Here's an example:
- can't be blank + can't be blank
``` diff --git a/lib/bootstrap_form/form_builder.rb b/lib/bootstrap_form/form_builder.rb index e595dfb94..6a8d44d92 100644 --- a/lib/bootstrap_form/form_builder.rb +++ b/lib/bootstrap_form/form_builder.rb @@ -248,7 +248,7 @@ def form_group(*args, &block) options[:class] = ["form-group", options[:class]].compact.join(' ') options[:class] << " row" if get_group_layout(options[:layout]) == :horizontal options[:class] << " form-inline" if field_inline_override?(options[:layout]) - options[:class] << " #{feedback_class}" if options[:icon] + options[:class] << " #{error_class}" if has_error?(name) content_tag(:div, options.except(:append, :id, :label, :help, :icon, :input_group_class, :label_col, :control_col, :layout, :prepend)) do label = generate_label(options[:id], name, options[:label], options[:label_col], options[:layout]) if options[:label] @@ -336,8 +336,8 @@ def control_class "form-control" end - def feedback_class - "has-feedback" + def error_class + 'has-danger' end def control_specific_class(method) @@ -475,7 +475,7 @@ def generate_label(id, name, options, custom_label_col, group_layout) def generate_help(name, help_text) if has_error?(name) && inline_errors help_text = get_error_messages(name) - help_klass = 'invalid-feedback' + help_klass = 'form-control-feedback' help_tag = :div end return if help_text == false diff --git a/test/bootstrap_fields_test.rb b/test/bootstrap_fields_test.rb index 04e2df629..d1c7b7cba 100644 --- a/test/bootstrap_fields_test.rb +++ b/test/bootstrap_fields_test.rb @@ -101,13 +101,13 @@ class BootstrapFieldsTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
-
error for test
+
HTML diff --git a/test/bootstrap_form_group_test.rb b/test/bootstrap_form_group_test.rb index b26747dec..4c5c31c0f 100644 --- a/test/bootstrap_form_group_test.rb +++ b/test/bootstrap_form_group_test.rb @@ -154,7 +154,7 @@ class BootstrapFormGroupTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
@@ -164,7 +164,7 @@ class BootstrapFormGroupTest < ActionView::TestCase
.00
-
can't be blank, is too short (minimum is 5 characters) +
@@ -337,9 +337,9 @@ class BootstrapFormGroupTest < ActionView::TestCase end expected = <<-HTML.strip_heredoc -
+

Bar

-
can't be blank, is too short (minimum is 5 characters)
+
HTML assert_equivalent_xml expected, output @@ -360,14 +360,14 @@ class BootstrapFormGroupTest < ActionView::TestCase assert @user.invalid? expected = <<-HTML.strip_heredoc -
+
-
can't be blank, is too short (minimum is 5 characters)
+
HTML assert_equivalent_xml expected, @builder.email_field(:email, wrapper_class: 'none-margin') @@ -384,10 +384,10 @@ class BootstrapFormGroupTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
-
can't be blank, is too short (minimum is 5 characters)
+
HTML diff --git a/test/bootstrap_form_test.rb b/test/bootstrap_form_test.rb index 5e15c7584..2da276a1f 100644 --- a/test/bootstrap_form_test.rb +++ b/test/bootstrap_form_test.rb @@ -407,7 +407,7 @@ class BootstrapFormTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
@@ -423,10 +423,10 @@ class BootstrapFormTest < ActionView::TestCase expected = <<-HTML.strip_heredoc -
+
-
can't be blank, is too short (minimum is 5 characters) + HTML @@ -443,10 +443,10 @@ class BootstrapFormTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
-
can't be blank, is too short (minimum is 5 characters)
+
HTML @@ -637,10 +637,10 @@ class BootstrapFormTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
-
can't be blank, is too short (minimum is 5 characters)
+
HTML @@ -658,14 +658,14 @@ class BootstrapFormTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
-
can't be blank, is too short (minimum is 5 characters) + HTML @@ -683,7 +683,7 @@ class BootstrapFormTest < ActionView::TestCase expected = <<-HTML.strip_heredoc
-
+
This is required diff --git a/test/bootstrap_selects_test.rb b/test/bootstrap_selects_test.rb index 2ccfa7c8c..0c16a4c47 100644 --- a/test/bootstrap_selects_test.rb +++ b/test/bootstrap_selects_test.rb @@ -29,10 +29,10 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) expected = <<-HTML.strip_heredoc -
+
-
error for test
+
HTML @@ -170,10 +170,10 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) expected = <<-HTML.strip_heredoc
-
+
-
error for test
+
HTML @@ -219,10 +219,10 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) expected = <<-HTML.strip_heredoc
-
+
-
error for test
+
HTML @@ -281,7 +281,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) expected = <<-HTML.strip_heredoc
-
+
-
error for test
+
HTML @@ -382,7 +382,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) expected = <<-HTML.strip_heredoc
-
+
@@ -396,7 +396,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) #{options_range(start: "00", stop: "59", selected: "00")}
-
error for test
+
HTML @@ -490,7 +490,7 @@ def options_range(start: 1, stop: 31, selected: nil, months: false) expected = <<-HTML.strip_heredoc
-
+
-
error for test
+
HTML