diff options
author | George Claghorn <george@basecamp.com> | 2019-01-24 11:46:42 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2019-01-24 11:46:42 -0500 |
commit | c1e949e9e618f75dc446ffa584c3b441c48714b1 (patch) | |
tree | 3986e58a1759ce3954c7df7c3d8a9b30937db839 /actionview/lib/action_view | |
parent | 1fecebae31029cf2287f2bae88e8730f00569778 (diff) | |
download | rails-c1e949e9e618f75dc446ffa584c3b441c48714b1.tar.gz rails-c1e949e9e618f75dc446ffa584c3b441c48714b1.tar.bz2 rails-c1e949e9e618f75dc446ffa584c3b441c48714b1.zip |
Prefer ImageProcessing's resize_to_limit macro over resize_to_fit
Don't upsize images smaller than the specified dimensions.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/asset_tag_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb index c186cb8422..59d70a1dc4 100644 --- a/actionview/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb @@ -329,14 +329,14 @@ module ActionView # image_tag("pic.jpg", srcset: [["pic_1024.jpg", "1024w"], ["pic_1980.jpg", "1980w"]], sizes: "100vw") # # => <img src="/assets/pic.jpg" srcset="/assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw"> # - # Active Storage (images that are uploaded by the users of your app): + # Active Storage blobs (images that are uploaded by the users of your app): # # image_tag(user.avatar) # # => <img src="/rails/active_storage/blobs/.../tiger.jpg" /> - # image_tag(user.avatar.variant(resize_to_fit: [100, 100])) - # # => <img src="/rails/active_storage/variants/.../tiger.jpg" /> - # image_tag(user.avatar.variant(resize_to_fit: [100, 100]), size: '100') - # # => <img width="100" height="100" src="/rails/active_storage/variants/.../tiger.jpg" /> + # image_tag(user.avatar.variant(resize_to_limit: [100, 100])) + # # => <img src="/rails/active_storage/representations/.../tiger.jpg" /> + # image_tag(user.avatar.variant(resize_to_limit: [100, 100]), size: '100') + # # => <img width="100" height="100" src="/rails/active_storage/representations/.../tiger.jpg" /> def image_tag(source, options = {}) options = options.symbolize_keys check_for_image_tag_errors(options) |