You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

14 lines
273 B

module ApplicationHelper
def svg(name)
file_path = "#{Rails.root}/app/assets/images/#{name}.svg"
if File.exist?(file_path)
Rails.cache.fetch(['svg', name]) do
File.read(file_path).html_safe
end
else
'(not found)'
end
end
end