forgeplus/app/helpers/pdfkit_helper.rb

5 lines
130 B
Ruby

module PdfkitHelper
def download_image(url)
'data:image/png;base64,' + Base64.encode64(open(url) { |io| io.read })
end
end