diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index ec61daf2d0e..a0f7144f937 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -645,15 +645,17 @@ You should also make sure that the generated URLs use the CDN host instead of yo ```ruby # config/routes.rb direct :cdn_image do |model, options| + expires_in = options.delete(:expires_in) { ActiveStorage.urls_expire_in } + if model.respond_to?(:signed_id) route_for( :rails_service_blob_proxy, - model.signed_id, + model.signed_id(expires_in: expires_in), model.filename, options.merge(host: ENV['CDN_HOST']) ) else - signed_blob_id = model.blob.signed_id + signed_blob_id = model.blob.signed_id(expires_in: expires_in) variation_key = model.variation.key filename = model.blob.filename