diff --git a/app/helpers/icon_helper.rb b/app/helpers/icon_helper.rb index 0346b33..c816db6 100644 --- a/app/helpers/icon_helper.rb +++ b/app/helpers/icon_helper.rb @@ -1,9 +1,13 @@ # Font Awesome Helper module IconHelper - def fa_icon(name, extra_class = nil, style: :solid, size: nil) - content_class = "fa-#{style.to_s.dasherize} fa-#{name.to_s.dasherize}" - content_class << " fa-#{size.to_s.dasherize}" if size - content_class << " #{extra_class}" if extra_class - tag.i(class: content_class, 'aria-hidden': true) + def fa_icon(name, html_options = {}) + html_options[:style] ||= :solid + html_options['aria-hidden'] ||= true + + content_class = "fa-#{html_options[:style].to_s.dasherize} fa-#{name.to_s.dasherize}" + content_class << " fa-#{html_options[:size].to_s.dasherize}" if html_options.key? :size + content_class << " #{html_options[:class]}" if html_options.key? :class + + tag.i(class: content_class, 'aria-hidden': html_options['aria-hidden']) end end diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb index bc910a7..bc6bcff 100644 --- a/app/views/layouts/_navbar.html.erb +++ b/app/views/layouts/_navbar.html.erb @@ -1,9 +1,10 @@