Upload image to Rails server through Ember.js application

As the tins say, I'm trying to upload an image with my Ember.js application to the Rails backend, which uses Paperclip to control file uploads. I looked around and couldn't see an easy way to do this, does anyone know of a good solution here?

+4
source share
3 answers

Recently, I came across a similar one, and it turned out that there are many complications with downloading files - does this device support it, do you want to style the input that starts the download, etc.

We chose to download the jquery file: https://github.com/blueimp/jQuery-File-Upload

The approach I took is to download directly to S3 from the browser, and then set the token that S3 returns as a property on the model, and then save it to the server. Then, on the server, you set a background job to pull this file out of S3 and place it where it should be.

+2
source

I wrote a fairly simple example of loading the ember.js file a few months ago, which shows how you can write a custom view + a custom adapter that allows you to publish a multi-page form on the server. The example I made is built for python / django, but concepts should apply

https://github.com/toranb/ember-file-upload

I recently updated this to RC1 (e.g. 5 minutes ago) and it seems to still work: D

+1
source

Now there is an Ember Uploader plugin for Ember. I'm just integrating it now.

I have a couple of excesses that I'm smoothing out, but that seems pretty legal. Probably less configuration than loading a jquery file.

+1
source

All Articles