0
Raylar 4 app var. Farklı rafine yükleyiciler için S3'te bir alt klasör sistemi oluşturmaya çalışıyorum. Aşağıdaki kodu denedim ama işe yaramadı. Hiçbir şey S3'e yüklenmedi ve uygulamada görüntülenmedi.raylar refrakterli S3 alt klasörleri
Neyi özledim?
günlükleri:
20:24:09 puma.1 | Started GET "/attachments/refile_caches_backend/presign?t=1459707849942.0" for ::1 at 2016-04-03 20:24:09 +0200
20:24:10 puma.1 | Refile::App: [2016-04-03 20:24:10 +0200] GET "/refile_caches_backend/presign?t=1459707849942.0" 404 29.7ms
refile.rb
require "refile/s3"
aws = {
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
region: "us-east-1",
bucket: ENV['S3_BUCKET_NAME']
}
message_files = aws.merge({bucket: "message_files"})
product_files = aws.merge({bucket: "product_files"})
refile_caches = aws.merge({bucket: "refile_caches"})
Refile.backends["message_files_backend"] = Refile::S3.new(prefix: "store", **message_files)
Refile.backends["product_files_backend"] = Refile::S3.new(prefix: "store", **product_files)
Refile.backends["refile_caches_backend"] = Refile::S3.new(max_size: 5.megabytes, prefix: "cache", **refile_caches)
Refile.cdn_host = ENV['CLOUDFRONT_URL']
message.rb
class Message < ActiveRecord::Base
attachment :message_attachment, store: 'message_files_backend', cache: 'refile_caches_backend' ,extension: ["pdf", "doc", "docx", "xls", "xlsx", "html", "png", "img", "jpg"]
end