aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/models/active_storage/variant.rb
diff options
context:
space:
mode:
authorJanko Marohnić <janko.marohnic@gmail.com>2018-04-23 21:04:35 +0200
committerJanko Marohnić <janko.marohnic@gmail.com>2018-04-23 21:04:35 +0200
commiteef0bd0c0a4da52a111639cb9fb5823057cbdf27 (patch)
tree36d4daae99ba0264a4b5c805a3529d252a812a31 /activestorage/app/models/active_storage/variant.rb
parentdc97f6c3fd2769ba29ea06a6015244be18a19893 (diff)
downloadrails-eef0bd0c0a4da52a111639cb9fb5823057cbdf27.tar.gz
rails-eef0bd0c0a4da52a111639cb9fb5823057cbdf27.tar.bz2
rails-eef0bd0c0a4da52a111639cb9fb5823057cbdf27.zip
Recommend using :resize_to_fit after all
Diffstat (limited to 'activestorage/app/models/active_storage/variant.rb')
-rw-r--r--activestorage/app/models/active_storage/variant.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activestorage/app/models/active_storage/variant.rb b/activestorage/app/models/active_storage/variant.rb
index fcc831ee34..b782489a92 100644
--- a/activestorage/app/models/active_storage/variant.rb
+++ b/activestorage/app/models/active_storage/variant.rb
@@ -27,7 +27,7 @@ require "active_storage/downloading"
# To refer to such a delayed on-demand variant, simply link to the variant through the resolved route provided
# by Active Storage like so:
#
-# <%= image_tag Current.user.avatar.variant(resize: "100x100") %>
+# <%= image_tag Current.user.avatar.variant(resize_to_fit: [100, 100]) %>
#
# This will create a URL for that specific blob with that specific variant, which the ActiveStorage::RepresentationsController
# can then produce on-demand.
@@ -36,15 +36,15 @@ require "active_storage/downloading"
# has already been processed and uploaded to the service, and, if so, just return that. Otherwise it will perform
# the transformations, upload the variant to the service, and return itself again. Example:
#
-# avatar.variant(resize: "100x100").processed.service_url
+# avatar.variant(resize_to_fit: [100, 100]).processed.service_url
#
# This will create and process a variant of the avatar blob that's constrained to a height and width of 100.
# Then it'll upload said variant to the service according to a derivative key of the blob and the transformations.
#
-# You can combine any number of ImageMagick/libvips operations into a variant. In addition to that, you can also use
-# any macros provided by the ImageProcessing gem (such as +resize_to_limit+).
+# You can combine any number of ImageMagick/libvips operations into a variant, as well as any macros provided by the
+# ImageProcessing gem (such as +resize_to_fit+):
#
-# avatar.variant(resize_to_limit: [800, 800], monochrome: true, flip: "-90")
+# avatar.variant(resize_to_fit: [800, 800], monochrome: true, flip: "-90")
#
# Visit the following links for a list of available ImageProcessing commands and ImageMagick/libvips operations:
#