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
|