0.0
No commit activity in last 3 years
No release in over 3 years
This gem makes it easy to integrate redactor.js with amazon s3
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

RedactorS3¶ ↑

This gem provides easy integration between redactor.js and Amazon S3 for rails applications

Getting started¶ ↑

  1. Add the gem:

    gem 'redactor_s3'
    
  2. Mount it inside your routes:

    mount RedactorS3::Engine => "/s3"
    
  3. Run the installer:

    rails generate redactor_s3:install
    

Dont forget to edit the config file

Usage¶ ↑

To use it you need to render some hidden fields in the views where you will be using redactor

Example:

# edit.html.rb
...
...
<textarea class="redactor"></textarea>
<%= render 'redactor_s3/config' %>

You then need to configure your redactor instance in jquery:

# edit.js
...
...
$("textarea.redactor").redactor({
    ...
    ...
    imageUpload: $("#aws_endpoint").val(),
    uploadCrossDomain: true,
    uploadFields: {
        'key': '#aws_key',
        'AWSAccessKeyId': '#aws_access_key',
        'acl': '#aws_acl',
        'success_action_redirect': '#aws_success_path',
        'policy': '#aws_policy',
        'signature': '#aws_signature',
        'Content-Type': '#aws_content_type'
    },
    imageGetJson: $("#aws_files_path").val()
});

You should now be good to go

License¶ ↑

This project rocks and uses MIT-LICENSE.