Skip to content

Instantly share code, notes, and snippets.

View bkenny's full-sized avatar
💭
Shipping Products

Brian Kenny bkenny

💭
Shipping Products
View GitHub Profile
@WizardOfOgz
WizardOfOgz / gist:1012107
Created June 7, 2011 12:13
Save Base64-encoded images with Paperclip
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#',
@peiyush13
peiyush13 / changes_in_login_form.html.erb
Last active November 13, 2022 11:32
Client Side Encryption in Rails
<div class="input-container">
<%= f.password_field :password, placeholder: "Password", tabindex: "2", required: "required", data: { encrypt: true } %>
</div>
<div class="hidden" id="public_key" data-value= "<%= sanitize @public_key %>"></div>