Module: SpectatorSport::Dashboard::IconsHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/spectator_sport/dashboard/icons_helper.rb

Instance Method Summary collapse

Instance Method Details

#icons_pathObject



10
11
12
# File 'app/helpers/spectator_sport/dashboard/icons_helper.rb', line 10

def icons_path
  @_icons_path ||= frontend_static_path(:icons, format: :svg, locale: nil)
end

#render_icon(name, class: nil, **options) ⇒ Object



4
5
6
7
8
# File 'app/helpers/spectator_sport/dashboard/icons_helper.rb', line 4

def render_icon(name, class: nil, **options)
  tag.svg(viewBox: "0 0 16 16", class: "svg-icon #{binding.local_variable_get(:class)}", **options) do
    tag.use(fill: "currentColor", href: "#{icons_path}##{name}")
  end
end