You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
502 B

  1. # Font Awesome Helper
  2. module IconHelper
  3. def fa_icon(name, html_options = {})
  4. html_options[:style] ||= :solid
  5. html_options['aria-hidden'] ||= true
  6. content_class = "fa-#{html_options[:style].to_s.dasherize} fa-#{name.to_s.dasherize}"
  7. content_class << " fa-#{html_options[:size].to_s.dasherize}" if html_options.key? :size
  8. content_class << " #{html_options[:class]}" if html_options.key? :class
  9. tag.i(class: content_class, 'aria-hidden': html_options['aria-hidden'])
  10. end
  11. end