Module: Healthicons::Rails::ViewHelpers

Defined in:
lib/healthicons/rails/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#healthicon(icon, **options) ⇒ String

Allow the healthcare icon to be called in rails, so icons can be added to the views

Parameters:

  • icon (String)

    icon image name

  • options (Hash)

    additional attributes you want to apply to the SVG

Returns:

  • (String)

    the SVG/XML contents of the icon



11
12
13
# File 'lib/healthicons/rails/view_helpers.rb', line 11

def healthicon(icon, **options)
  Healthicons::Icon.call(icon, options)&.html_safe
end