How to use S3#url public: option as default

367 views
Skip to first unread message

gs...@venturemedia.com

unread,
Jun 24, 2016, 4:18:29 PM6/24/16
to Shrine
I looked for a way to use this but I think I'm missing something obvious.  Currently the URLs that I'm generating have all the AWS access control query parameters.  I'd like to remove this since my bucket is set up to server public files (via CloudFront).

I'm just at a loss as to how to configure my Shrine uploader or storage to generate URLs with `public: true`.

Can anybody point me in the right direction? 

Thanks for any help!

Gerry

Janko Marohnić

unread,
Jun 24, 2016, 11:48:27 PM6/24/16
to gs...@venturemedia.com, Shrine
Hi Gerry,

You can use the default_url_options plugin, which will automatically set the default URL options for the specified storage:

plugin :default_url_options, store: {public: true}

If your cache storage is also S3 (direct uploads), you can also set it for the cache storage:

plugin :default_url_options, cache: {public: true}, store: {public: true}

Regards,
Janko

--
You received this message because you are subscribed to the Google Groups "Shrine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine...@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/0a316cdc-a9ae-40e5-9f19-6651753d5eb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gerry Shaw

unread,
Jun 25, 2016, 12:46:34 AM6/25/16
to Shrine
Perfect, exactly what I was looking for.  Not sure how I missed that.

Thanks Janko!

Reply all
Reply to author
Forward
0 new messages