Add linked SVG image to button

This commit is contained in:
2023-04-08 00:31:59 +02:00
parent d9943752e8
commit 7d0da45653
7 changed files with 23 additions and 5 deletions

View File

@@ -25,4 +25,11 @@ module ApplicationHelper
options.merge! builder: TabularFormBuilder
form_for(record, **options, &block)
end
def svg_tag(source, options = {})
image_name, id = source.split('#')
content_tag :svg, options do
tag.use href: "#{image_path(image_name)}##{id}"
end
end
end