diff options
author | George Claghorn <george.claghorn@gmail.com> | 2017-09-28 16:43:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-28 16:43:37 -0400 |
commit | d30586211b41e018869a1a3f4e3af778a31591db (patch) | |
tree | 664028edf779b3a6d55e08c2503cfe91e2309eff /activestorage/config | |
parent | f7b4be40410432b77e0c5d114b0ce73480ff984d (diff) | |
download | rails-d30586211b41e018869a1a3f4e3af778a31591db.tar.gz rails-d30586211b41e018869a1a3f4e3af778a31591db.tar.bz2 rails-d30586211b41e018869a1a3f4e3af778a31591db.zip |
Preview PDFs and videos
Diffstat (limited to 'activestorage/config')
-rw-r--r-- | activestorage/config/routes.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activestorage/config/routes.rb b/activestorage/config/routes.rb index c3194887be..c659e079fd 100644 --- a/activestorage/config/routes.rb +++ b/activestorage/config/routes.rb @@ -24,6 +24,19 @@ Rails.application.routes.draw do resolve("ActiveStorage::Variant") { |variant| route_for(:rails_variant, variant) } + get "/rails/active_storage/previews/:signed_blob_id/:variation_key/*filename" => "active_storage/previews#show", as: :rails_blob_preview, internal: true + + direct :rails_preview do |preview| + signed_blob_id = preview.blob.signed_id + variation_key = preview.variation.key + filename = preview.blob.filename + + route_for(:rails_blob_preview, signed_blob_id, variation_key, filename) + end + + resolve("ActiveStorage::Preview") { |preview| route_for(:rails_preview, preview) } + + get "/rails/active_storage/disk/:encoded_key/*filename" => "active_storage/disk#show", as: :rails_disk_service, internal: true put "/rails/active_storage/disk/:encoded_token" => "active_storage/disk#update", as: :update_rails_disk_service, internal: true post "/rails/active_storage/direct_uploads" => "active_storage/direct_uploads#create", as: :rails_direct_uploads, internal: true |