Skip to content

Instantly share code, notes, and snippets.

View stouset's full-sized avatar

Stephen Touset stouset

View GitHub Profile
@stouset
stouset / controller.rb
Created October 19, 2011 14:31
Transloadit-Paperclip integration
def decode_transloadit_json
return unless params[:transloadit].present?
# wrap transloadit params in a HashWithIndifferentAccess
params[:transloadit] = ActiveSupport::HashWithIndifferentAccess.new(
ActiveSupport::JSON.decode params[:transloadit]
)
# decode parameters from transloadit
params[:transloadit][:uploads].first.tap do |history|