1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/config/routes.rb

14 lines
752 B
Ruby
Raw Normal View History

2017-07-21 16:50:19 -04:00
ActiveStorage::Engine.routes.draw do
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
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-21 17:12:29 -04:00
route_for(:rails_blob_variant, encoded_blob_key, variantion_key, filename)
end
end