Module: BasiconsHelper
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/basicons_helper/helper.rb,
lib/basicons_helper/railtie.rb,
lib/basicons_helper/version.rb
Defined Under Namespace
Classes: Railtie
Constant Summary collapse
- VERSION =
'1.0.3'.freeze
Instance Method Summary collapse
Instance Method Details
#basicon(symbol, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/basicons_helper/helper.rb', line 8 def basicon(symbol, = {}) return '' if symbol.nil? cache_key = [symbol, ] if tag = basicons_helper_cache[cache_key] tag else icon = Basicons::Basicon.new(symbol, ) tag = content_tag(:svg, icon.data.html_safe, icon.).freeze basicons_helper_cache[cache_key] = tag tag end end |