Add images to session links

This commit is contained in:
2023-04-08 04:19:36 +02:00
parent 7d0da45653
commit a46c41197c
7 changed files with 21 additions and 11 deletions

View File

@@ -26,6 +26,11 @@ module ApplicationHelper
form_for(record, **options, &block)
end
def image_link_to(name, image = nil, options = nil, html_options = nil)
name = svg_tag("pictograms/#{image}.svg#icon") + name if image
link_to name, options, html_options
end
def svg_tag(source, options = {})
image_name, id = source.split('#')
content_tag :svg, options do