I’m using CKEditor and I’ve configured it to work with Paperclip but I can’t tell it to store files in S3, so it’s storing them using Paperclip but on the local filesystem.
So I was wondering if there is some way to tell Paperclip to explicitly use S3 everytime it’s used.
I know how I can configure Paperclip with S3 on certain models (pretty easy, described on the paperclip github wiki). I’m deploying on Heroku that’s why I can’t write to the local filesystem.
One way is to see what the ckeditor install generator is doing.
For example, if using ActiveRecord as ORM, take a look at the templates being used for the models that use Paperclip here.
The generator actually copies this templates into your app/models/ckeditor folder. You could edit them and configure as needed for Paperclip to use S3.
For ActiveRecord, the models are:
Keep in mind that this approach could give you extra work in the future if the ckeditor gem is updated and the update process needs to overwrite this models.
Else, you can use Paperclip default options. In you Paperclip initializer (/config/initializers/paperclip.rb) use: