From 9d5b553db17e17da6e7cda81eabd6b949311ea3c Mon Sep 17 00:00:00 2001 From: Anton Pawlik Date: Mon, 24 Oct 2016 12:19:03 +0200 Subject: [PATCH] show field's help message even on validation error --- CHANGELOG.md | 2 +- lib/bootstrap_form/components/hints.rb | 2 +- test/bootstrap_form_group_test.rb | 1 + test/bootstrap_form_test.rb | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9394779..6ff9979ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ### Bugfixes -* Your contribution here! +* [#284] [#300] Field's help message is displayed, even while inline error message is displayed. - [@antpaw](https://github.com/antpaw) ## [4.2.0][] (2019-03-08) diff --git a/lib/bootstrap_form/components/hints.rb b/lib/bootstrap_form/components/hints.rb index 93d10aac6..0b4868a5a 100644 --- a/lib/bootstrap_form/components/hints.rb +++ b/lib/bootstrap_form/components/hints.rb @@ -8,7 +8,7 @@ module Hints private def generate_help(name, help_text) - return if help_text == false || inline_error?(name) + return if help_text == false help_klass ||= "form-text text-muted" help_text ||= get_help_text_by_i18n_key(name) diff --git a/test/bootstrap_form_group_test.rb b/test/bootstrap_form_group_test.rb index b92fa7c8c..092bb3c3d 100644 --- a/test/bootstrap_form_group_test.rb +++ b/test/bootstrap_form_group_test.rb @@ -495,6 +495,7 @@ class BootstrapFormGroupTest < ActionView::TestCase
can't be blank, is too short (minimum is 5 characters)
+ This is required HTML diff --git a/test/bootstrap_form_test.rb b/test/bootstrap_form_test.rb index 849f21079..47d57753f 100644 --- a/test/bootstrap_form_test.rb +++ b/test/bootstrap_form_test.rb @@ -686,6 +686,7 @@ class BootstrapFormTest < ActionView::TestCase
can't be blank, is too short (minimum is 5 characters)
+ This is required HTML @@ -711,6 +712,7 @@ class BootstrapFormTest < ActionView::TestCase
can't be blank, is too short (minimum is 5 characters) + This is required
HTML