Fix typos sanitizing checkbox labels

This commit is contained in:
Javi Martín
2019-10-11 17:11:20 +02:00
parent 68ca29fa8b
commit 17ae9c96dc

View File

@@ -21,7 +21,7 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
def check_box(attribute, options = {}) def check_box(attribute, options = {})
if options[:label] != false if options[:label] != false
label = content_tag(:span, sanitize(label_text(object, attribute, options[:label]), class: "checkbox")) label = content_tag(:span, sanitize(label_text(object, attribute, options[:label])), class: "checkbox")
super(attribute, options.merge(label: label, label_options: label_options_for(options))) super(attribute, options.merge(label: label, label_options: label_options_for(options)))
else else
@@ -76,7 +76,7 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
def help_text_id(attribute, options) def help_text_id(attribute, options)
if options[:hint] if options[:hint]
"#{custom_label(attribute, nil, nil).match(/for=\"(.+)\"/)[1]}-help-text" "#{custom_label(attribute, nil, nil).match(/for="([^"]+)"/)[1]}-help-text"
end end
end end
end end