From f0d1a98e29b4663b789d2d0ff10d85b6cfb6e6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Tue, 6 Feb 2024 14:07:09 +0100 Subject: [PATCH] use resize_to_fit --- app/admin/organization.rb | 4 ++-- app/helpers/application_helper.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/organization.rb b/app/admin/organization.rb index 62f85c35..2d8fe6dc 100644 --- a/app/admin/organization.rb +++ b/app/admin/organization.rb @@ -5,7 +5,7 @@ output = tag.p organization.name if organization.logo.attached? - output << image_tag(organization.logo.variant(resize: "40^x")) + output << image_tag(organization.logo.variant(resize_to_fill: [40, nil])) end output.html_safe @@ -29,7 +29,7 @@ show do div do if organization.logo.attached? - image_tag(organization.logo.variant(resize: "100^x")) + image_tag(organization.logo.variant(resize_to_fill: [100, nil])) end end default_main_content diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5fe37cdd..eff524c3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -8,7 +8,7 @@ def page_title def avatar_url(user, size = 32) user.avatar.attached? ? - user.avatar.variant(resize: "#{size}x#{size}") : + user.avatar.variant(resize_to_fit: [size, size]) : gravatar_url(user, size) end @@ -31,7 +31,7 @@ def organization_logo return if "#{controller_name}##{action_name}".in? %w(organizations#index pages#show) content_tag(:div, class: "row organization-logo") do - image_tag org.logo.variant(resize: "x200^") + image_tag org.logo.variant(resize_to_fit: [200, nil]) end end