Skip to content

Instantly share code, notes, and snippets.

@JamesDullaghan
Created December 6, 2013 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesDullaghan/7831164 to your computer and use it in GitHub Desktop.
Save JamesDullaghan/7831164 to your computer and use it in GitHub Desktop.
base64
def sticker_image_path
src = "data:image/png;base64,"
src += ActiveSupport::Base64.encode64(File.read("#{Rails.root}/app/assets/images/courses/#{self.slug}-sticker.png"))
src
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment