Sha256: 6eb8d5c7b1100d5eb38ee942d47c3fc7a1f4f3df0878f5f5fa1f0015d73b1133

Contents?: true

Size: 1.93 KB

Versions: 2

Compression:

Stored size: 1.93 KB

Contents

# frozen_string_literal: true

Rails.application.routes.draw do
  get "/rails/active_storage/blobs/:signed_id/*filename" => "active_storage/blobs#show", as: :rails_service_blob, internal: true

  direct :rails_blob do |blob, options|
    route_for(:rails_service_blob, blob.signed_id, blob.filename, options)
  end

  resolve("ActiveStorage::Blob")       { |blob, options| route_for(:rails_blob, blob) }
  resolve("ActiveStorage::Attachment") { |attachment, options| route_for(:rails_blob, attachment.blob, options) }


  get "/rails/active_storage/variants/:signed_blob_id/:variation_key/*filename" => "active_storage/variants#show", as: :rails_blob_variation, internal: true

  direct :rails_variant do |variant, options|
    signed_blob_id = variant.blob.signed_id
    variation_key  = variant.variation.key
    filename       = variant.blob.filename

    route_for(:rails_blob_variation, signed_blob_id, variation_key, filename, options)
  end

  resolve("ActiveStorage::Variant") { |variant, options| route_for(:rails_variant, variant, options) }


  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, options|
    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, options)
  end

  resolve("ActiveStorage::Preview") { |preview, options| route_for(:rails_preview, preview, options) }


  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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activestorage-5.2.0.beta2 config/routes.rb
activestorage-5.2.0.beta1 config/routes.rb