2017-07-21 16:50:19 -04:00
|
|
|
ActiveStorage::Engine.routes.draw do
|
2017-07-20 18:33:31 -04:00
|
|
|
get "/rails/active_storage/disk/:encoded_key/*filename" => "active_storage/disk#show", as: :rails_disk_blob
|
2017-07-21 17:12:29 -04:00
|
|
|
get "/rails/active_storage/variants/:encoded_blob_key/:variation_key/*filename" => "active_storage/variants#show", as: :rails_blob_variant
|
2017-07-20 18:33:31 -04:00
|
|
|
post "/rails/active_storage/direct_uploads" => "active_storage/direct_uploads#create", as: :rails_direct_uploads
|
|
|
|
|
|
|
|
resolve 'ActiveStorage::Variant' do |variant|
|
2017-07-21 17:12:29 -04:00
|
|
|
encoded_blob_key = ActiveStorage::VerifiedKeyWithExpiration.encode(variant.blob.key)
|
|
|
|
variantion_key = ActiveStorage::Variation.encode(variant.variation)
|
|
|
|
filename = variant.blob.filename
|
2017-07-20 18:33:31 -04:00
|
|
|
|
2017-07-21 17:12:29 -04:00
|
|
|
route_for(:rails_blob_variant, encoded_blob_key, variantion_key, filename)
|
2017-07-20 18:33:31 -04:00
|
|
|
end
|
|
|
|
end
|