Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.12 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.12 KB

uppy-activestorage-upload

Uppy logo: a superman puppy in a pink suit

The ActiveStorage Upload plugin handles Ruby on Rails ActiveStorage direct uploads with Uppy.

Example

Add this line to your HEAD tag.

<%= tag.meta name: "direct-upload-url", content: rails_direct_uploads_path %>

Then use ActiveStorageUpload as an Uppy plugin in your Javascript pack with Webpacker.

const Uppy = require('@uppy/core')
const ActiveStorageUpload = require('uppy-activestorage-upload')

const uppy = Uppy()
uppy.use(ActiveStorageUpload, {
  directUploadUrl: document.querySelector("meta[name='direct-upload-url']").getAttribute("content")
})

Installation

yarn add https://github.com/excid3/uppy-activestorage-upload
or
npm install https://github.com/excid3/uppy-activestorage-upload --save

We recommend installing from npm and then using a module bundler such as Webpack, Browserify or Rollup.js.

License

The MIT License.