Nomes de arquivos personalizados com Carrierwave e Amazon S3

Com o seguinte uploader app/uploaders/document_uploader.rb: class DocumentUploader < CarrierWave::Uploader::Base storage :fog def store_dir “uploads/#{Rails.env}/#{model.class.to_s.underscore.pluralize}/#{mounted_as}/#{model.id}” end end def store_path(for_file = filename) “uploads/#{Rails.env}/#{model.class.to_s.underscore.pluralize}/#{mounted_as}/#{model.id}/#{for_file}” end def filename(uploaded_file = file) if uploaded_file.present? “Document with …

Continuar lendo