module FoundationIcons::Sass::Rails::ViewHelpers

Public Instance Methods

icon(icon, text="", html_options={}) click to toggle source

Insert an icon into your view

@param

# File lib/foundation_icons/sass/rails/helpers.rb, line 8
def icon(icon, text="", html_options={})
  content_class = "fi-#{icon}"
  content_class << " #{html_options[:class]}" if html_options.key?(:class)
  html_options[:class] = content_class

  html = content_tag(:i, nil, html_options)
  html << " #{text}" unless text.blank?
  html.html_safe
end