Module: RailsuiIcon::Helpers

Includes:
ActionView::Helpers::AssetUrlHelper
Defined in:
lib/railsui_icon/helpers.rb

Instance Method Summary collapse

Instance Method Details

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



7
8
9
10
11
12
13
14
15
# File 'lib/railsui_icon/helpers.rb', line 7

def icon(name, options = {})
  options[:variant] ||= :outline
  options[:class] = options.fetch(:class, nil)
  custom_path = resolve_custom_path(options[:custom_path])

  result = RailsuiIcon::Icon.render(name: name, variant: options[:variant], options: options, custom_path: custom_path)

  result.html_safe
end