1
0
mirror of https://github.com/danbee/my-images synced 2025-03-04 08:49:05 +00:00
my-images/app/helpers/image_helper.rb
Dan Barber 5b2d1d4d17
Migrate images to Active Storage
Also adds a rake task to do the migration.
2018-11-16 17:16:01 -05:00

16 lines
287 B
Ruby

module ImageHelper
def image_variant(image, variant)
image.variant(variant)
end
def image_thumb(image, size)
image.variant(
combine_options: {
gravity: "center",
resize: "#{size}x#{size}^",
extent: "#{size}x#{size}",
},
)
end
end