From 686b3466bab78ca69eaab98d76cc489d84d5eb62 Mon Sep 17 00:00:00 2001 From: Jeffrey Guenther Date: Mon, 20 Nov 2017 17:01:00 -0800 Subject: Adds download link helper explanation --- guides/source/active_storage_overview.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'guides/source') diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index c3262c85e0..4b48d67e60 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -117,7 +117,7 @@ local: bucket: "" ``` -Also, add the S3 client gem to your Gemfile: +Also, add the Google Cloud Storage client gem to your Gemfile: ``` ruby gem "google-cloud-storage", "~> 1.3", require: false @@ -245,7 +245,7 @@ Link to Attachments Generate a permanent URL for the blob that points to the application. Upon access, a redirect to the actual service endpoint is returned. This indirection -decouples the public URL from the actual one, and allows for example mirroring +decouples the public URL from the actual one, and allows, for example, mirroring attachments in different services for high-availability. The redirection has an HTTP expiration of 5 min. @@ -253,6 +253,13 @@ HTTP expiration of 5 min. url_for(user.avatar) ``` +To create a download link, use the `rails_blob_{path|url}` helper. Using this +helper will allow you to set the filename and disposition. + +```ruby +rails_blob_path(user.avatar, disposition: "attachment", filename: "avatar.jpg") +``` + Create Variations of Attached Image ----------------------------------- -- cgit v1.2.3