Module: Shipyard::IconHelper

Includes:
ActionView::Context, ActionView::Helpers::TagHelper
Defined in:
app/helpers/shipyard/icon_helper.rb

Instance Method Summary collapse

Instance Method Details

#icon(name, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/helpers/shipyard/icon_helper.rb', line 6

def icon(name, options={})
  if name.is_a? Symbol
    svg = Icons.instance.find_by(symbol: name)
    svg_use_tag svg, options
  else
    svg = Icons.instance.find_by(id: name)
    svg_tag svg, options
  end
end