Sha256: 679ab0b44ba3fd64ffec729a203ebefab28c35a979bf4a2b66a68f61c1c8947d
Contents?: true
Size: 597 Bytes
Versions: 36
Compression:
Stored size: 597 Bytes
Contents
# frozen_string_literal: true ## # Module to help generate icon helpers for SVG images module Blacklight::IconHelperBehavior ## # Returns the raw SVG (String) for a Blacklight Icon located in # app/assets/images/blacklight/*.svg. Caches them so we don't have to look up # the svg everytime. # @param [String, Symbol] icon_name # @return [String] def blacklight_icon(icon_name, options = {}) Rails.cache.fetch([:blacklight_icons, icon_name, options]) do icon = Blacklight::Icon.new(icon_name, **options) tag.span(icon.svg.html_safe, **icon.options) end end end
Version data entries
36 entries across 36 versions & 1 rubygems