def external_icon(path, options = {})
      classes = _icon_classes(options) + ["external-icon"]

      if path.split(".").last == "svg"
        asset = Rails.application.assets_manifest.find_sources(path).first
        asset.gsub("<svg ", "<svg class=\"#{classes.join(" ")}\" ").html_safe
      else
        image_tag(path, class: classes.join(" "), style: "display: none")
      end
    end
def external_icon(path, options = {})
      classes = _icon_classes(options) + ["external-icon"]

      if path.split(".").last == "svg"
        asset = Rails.application.assets_manifest.find_sources(path).first
        asset.gsub("<svg ", "<svg class=\"#{classes.join(" ")}\" ").html_safe
      else
        image_tag(path, class: classes.join(" "), style: "display: none")
      end
    end
Outputs a SVG icon from an external file. It apparently renders an image
 tag, but then a JS script kicks in and replaces it with an inlined SVG
 version.

 path    - The asset's path

 Returns an <img /> tag with the SVG icon.