Skip to content

Commit

Permalink
Avoid mutation of string in bs3 support
Browse files Browse the repository at this point in the history
This will break if the string is frozen.  Found by Ruby 3.4's
string literal modification warning.
  • Loading branch information
jeremyevans committed May 22, 2024
1 parent 9b20cac commit 5cff8c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/forme/bs3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cff8c8

Please sign in to comment.