Skip to content

Instantly share code, notes, and snippets.

@camiloforero
Created September 30, 2019 13:34
Show Gist options
  • Save camiloforero/f69228c78ff943ce4ae5d6d4cbb4fee6 to your computer and use it in GitHub Desktop.
Save camiloforero/f69228c78ff943ce4ae5d6d4cbb4fee6 to your computer and use it in GitHub Desktop.
ActiveStorage routes
Rails.application.routes.draw do
scope ActiveStorage.routes_prefix do
get "/blobs/:signed_id/*filename" => "active_storage/blobs#show", as: :rails_service_blob
get "/representations/:signed_blob_id/:variation_key/*filename" => "active_storage/representations#show", as: :rails_blob_representation
get "/disk/:encoded_key/*filename" => "active_storage/disk#show", as: :rails_disk_service
put "/disk/:encoded_token" => "active_storage/disk#update", as: :update_rails_disk_service
post "/direct_uploads" => "active_storage/direct_uploads#create", as: :rails_direct_uploads
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment