From d861ea571ce2ac7959fc0a457f1a661550655c21 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Wed, 21 Feb 2018 12:10:49 -0800 Subject: [PATCH] Avoid frozen string error in button helper When button was passed an icon_name, which is deprecated but still prevalent, it would error with "can't modify frozen String". This commit avoids that issue by using string interpolation instead. --- backend/app/helpers/spree/admin/navigation_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/helpers/spree/admin/navigation_helper.rb b/backend/app/helpers/spree/admin/navigation_helper.rb index c34659e2d87..9b88c9029fa 100644 --- a/backend/app/helpers/spree/admin/navigation_helper.rb +++ b/backend/app/helpers/spree/admin/navigation_helper.rb @@ -128,7 +128,7 @@ def button(text, icon_name = nil, button_type = 'submit', options = {}) class_names = "button" if icon_name Spree::Deprecation.warn "Using icon_name arg is deprecated. Icons could not be visible in future versions.", caller - class_names.prepend "fa fa-#{icon_name} " + class_names = "fa fa-#{icon_name} #{class_names}" end button_tag(text, options.merge(type: button_type, class: class_names)) end