Skip to content

Commit

Permalink
use resize_to_fit
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Feb 6, 2024
1 parent 19b0eb8 commit f0d1a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/admin/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit f0d1a98

Please sign in to comment.