Commit 1fc0601d authored by Peter Leitzen's avatar Peter Leitzen

Pass formats explicitly when rendering svg icons

This commit avoids the deprecation warning

    Rendering actions with '.' in the name is deprecated
parent dfa36ea9
...@@ -9,9 +9,7 @@ module IconsHelper ...@@ -9,9 +9,7 @@ module IconsHelper
def custom_icon(icon_name, size: DEFAULT_ICON_SIZE) def custom_icon(icon_name, size: DEFAULT_ICON_SIZE)
memoized_icon("#{icon_name}_#{size}") do memoized_icon("#{icon_name}_#{size}") do
# We can't simply do the below, because there are some .erb SVGs. render partial: "shared/icons/#{icon_name}", formats: :svg, locals: { size: size }
# File.read(Rails.root.join("app/views/shared/icons/_#{icon_name}.svg")).html_safe
render "shared/icons/#{icon_name}.svg", size: size
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment