Skip to content

Instantly share code, notes, and snippets.

@aroth
aroth / transloadit_response.js
Created February 28, 2011 03:17
associate results within the 'uploads' key of a transloadit response (ruby/js)
$A( a.uploads ).each( function( upload, index ){
$H( a.results ).keys().each( function( key ){
a.results[ key ].each( function( r ){
if( r.original_id == upload.id ){
if( !upload['results'][key] ){
upload['results'][key] = {}
}
upload['results'][key] = r;
}
});