TinyMCE AWS File Upload
This gem basically includes TinyMCE 4 (thanks to gem tinymce-rails) and adds a File Upload functionality to it.
Installation
Add this line to your application's Gemfile:
gem 'tinymce_aws_file_upload', '~> 0.1.0'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tinymce_aws_file_upload
Usage
On your application.js add the line:
//= require tinymce-aws-file-upload
You need to configure your AWS bucket but setting these environment variables:
Don't forget to set the bucket permissions adding CORS configuration.
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_BUCKET
- AWS_AREA
- HOST (development will be http://localhost:3000/)
If you need help to configure environment variables at development, Heroku has a nice tutorial. To configure them on Heroku, you can see it here
In your coffeescript files add
root = exports ? this
root.initTinyMCE('class')
where class is a class you should add to all textareas which you want to add the Tinymce rich text editor.
Loading
If the function root.start_loading() and root.stop_loading() exists, those will be called when the file starts uploading and when it ends, respectively.
Contributing
- Fork it ( http://github.com/arielschvartz/tinymce_aws_file_upload/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request