Skip to content

Commit

Permalink
Fix simple icons with propshaft
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroe authored and MartinHinz committed Oct 25, 2024
1 parent 648c63f commit 8093121
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/simple_icons_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ def simple_icon(slug)
# adapted from https://blog.cloud66.com/using-svgs-in-a-rails-stack
def embedded_svg(filename, options = {})
assets = Rails.application.assets
asset = assets.find_asset(filename)
asset = assets.load_path.find(filename)

if asset
file = asset.source.force_encoding("UTF-8")
doc = Nokogiri::HTML::DocumentFragment.parse file
#file = asset.source.force_encoding("UTF-8")
doc = Nokogiri::HTML::DocumentFragment.parse asset.content
svg = doc.at_css "svg"
options.each {|attr, value| svg[attr.to_s] = value}
#svg["class"] = options[:class] if options[:class].present?
Expand Down

0 comments on commit 8093121

Please sign in to comment.