Created
May 23, 2019 15:13
-
-
Save BrandonMathis/9517125b6c80beda615ca0bc15ad7a25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = Repo.get(User, 1) | |
# To receive a single rendition: | |
MyApp.Avatar.url({user.avatar, user}, :thumb) | |
#=> "https://bucket.s3.amazonaws.com/uploads/avatars/1/thumb.png?v=63601457477" | |
# To receive all renditions: | |
MyApp.Avatar.urls({user.avatar, user}) | |
#=> %{original: "https://.../original.png?v=1234", thumb: "https://.../thumb.png?v=1234"} | |
# To receive a signed url: | |
MyApp.Avatar.url({user.avatar, user}, signed: true) | |
MyApp.Avatar.url({user.avatar, user}, :thumb, signed: true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment