forgeplus/app/helpers/pdfkit_helper.rb

5 lines
130 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
module PdfkitHelper
def download_image(url)
'data:image/png;base64,' + Base64.encode64(open(url) { |io| io.read })
end
end