· 7 years ago · Aug 22, 2018, 06:26 AM
1class UploadController < ActionController::Base
2
3 ...
4
5 def index
6 # Configuration object.
7 options = {
8 # The name of your bucket.
9 bucket: 'bucket-name',
10
11 # S3 region. If you are using the default us-east-1, it this can be ignored.
12 region: 'eu-west-1',
13
14 # The folder where to upload the images.
15 keyStart: 'uploads',
16
17 # File access.
18 acl: 'public-read',
19
20 # AWS keys.
21 accessKey: 'YOUR_AWS_ACCESS_KEY',
22 secretKey: 'YOUR_AWS_SECRET_KEY'
23 }
24
25 # Compute the signature.
26 @aws_data = FroalaEditorSDK::S3.data_hash(options)
27 end
28
29 ...
30
31end