From 5cff8c8e529d33dfd51a1c3c25a406da1fefbae0 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Wed, 22 May 2024 10:04:47 -0700 Subject: [PATCH] Avoid mutation of string in bs3 support This will break if the string is frozen. Found by Ruby 3.4's string literal modification warning. --- lib/forme/bs3.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/forme/bs3.rb b/lib/forme/bs3.rb index 7f7939f..ee5e2da 100644 --- a/lib/forme/bs3.rb +++ b/lib/forme/bs3.rb @@ -356,7 +356,7 @@ def call(tag) case tag.attr[:type].to_sym when :checkbox, :radio, :hidden # .form-control class causes rendering problems, so remove if found - tag.attr[:class].gsub!(/\s*form-control\s*/,'') if tag.attr[:class] + tag.attr[:class] = tag.attr[:class].gsub(/\s*form-control\s*/,'') if tag.attr[:class] tag.attr[:class] = nil if tag.attr[:class] && tag.attr[:class].empty? when :file