Do not generate an empty hint element when there's an empty hint

This commit is contained in:
taitus
2022-03-17 10:35:52 +01:00
committed by Javi Martín
parent ab0572f32a
commit d719b2291e
2 changed files with 9 additions and 2 deletions

View File

@@ -76,13 +76,13 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
end
def help_text(attribute, options)
if options[:hint]
if options[:hint].present?
tag.span options[:hint], class: "help-text", id: help_text_id(attribute, options)
end
end
def help_text_id(attribute, options)
if options[:hint]
if options[:hint].present?
"#{custom_label(attribute, nil, nil).match(/for="([^"]+)"/)[1]}-help-text"
end
end