mardi 27 octobre 2020

Asset pipeline error when trying to use Gemoji Gem

I getting an error whenever I try to use the gemoji gem. Does anybody know how to fix it?

app/helpers/application_helper.rb

def emojify(content)
    h(content).to_str.gsub(/:([\w+-]+):/) do |match|
      if emoji = Emoji.find_by_alias($1)
        %(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
      else
        match
      end
    end.html_safe if content.present?
  end
end

enter image description here

Aucun commentaire:

Enregistrer un commentaire