I just ran into this problem myself. The solution I came up with works for modern browsers (IE9+/chrome/FF/Safari). Not sure if that's something you can live with. If so:
1) You have to post the dataURI to your server. I don't think that's possible via standard form submission, but you can do it using HTML5 FormData sent via an XHR. Check out this SO entry on the basics of asynchronously posting a form using jQuery: How can I upload files asynchronously?
Alternatively, if you happen to be using Angular like me, you can use the angular-file-upload library https://github.com/danialfarid/angular-file-upload
Once you've created a formData object as described in that post, you can add your dataURI to it:
var formData = new FormData($('form')[0]);
formData.uploadImage = yourDataURI;
$.ajax({ // ... set up your ajax post as described in https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery
});
2) Once you post the data uri, the server-side is easy. Paperclip supports data uris out of the box, just set the paperclip attachment equal to your data uri. If you had an ActiveRecord object named ImagePost, with a paperclip attachment property named overlayed_image you controller might look like:
def update
image_post = ImagePost.find(params[:id])
if params['uploadImage']
image_post.overlayed_image = params[:uploadImage]
end
# rest of your controller code goes here
end