Skip to content

Instantly share code, notes, and snippets.

Avatar

Junichi Ito JunichiIto

View GitHub Profile
@WizardOfOgz
WizardOfOgz / gist:1012107
Created Jun 7, 2011
Save Base64-encoded images with Paperclip
View gist:1012107
class Avatar < ActiveRecord::Base
attr_accessor :content_type, :original_filename, :image_data
before_save :decode_base64_image
has_attached_file :image,
PAPERCLIP_CONFIG.merge(
:styles => {
:thumb => '32x32#',
:medium => '64x64#',