From 17ae9c96dc100fccefb68fc1a12f26b2ff569a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 11 Oct 2019 17:11:20 +0200 Subject: [PATCH] Fix typos sanitizing checkbox labels --- lib/consul_form_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/consul_form_builder.rb b/lib/consul_form_builder.rb index e5b77f69d..86c84589f 100644 --- a/lib/consul_form_builder.rb +++ b/lib/consul_form_builder.rb @@ -21,7 +21,7 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder def check_box(attribute, options = {}) 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))) else @@ -76,7 +76,7 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder def help_text_id(attribute, options) 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