Manual upload: Rails 6 — Active Storage, TinyMCE 5 and AWS S3

Kristina Kabošienė
1 min readFeb 18, 2020

--

Based on Mirko Akov blog post about Manual uploads using Active Storage, I’ve desided to share example of manual image upload to AWS S3 using Rails 6 Active Storage and TinyMCE 5 editor.

Gems I used:

gem “aws-sdk-s3”, require: false
gem ‘tinymce-rails’

Additional Uploader controller — gets image, uploads and returns url back to editor:

In tinymce.yml file add: images_upload_url: ‘/uploader/image’

In config/routes.rb add:

post ‘uploader/image’, to: ‘uploader#image’

In my _form.html.erb

That is it!

It took me one week to connect all dots, I hope it saves your time! 🦄

--

--