Module: Spina::ImagesHelper
- Defined in:
- app/helpers/spina/images_helper.rb
Instance Method Summary collapse
-
#variant(image, options) ⇒ Object
We wrap some Rails logic inside our own helper method because the resolve directive in ActiveStorage’s routes doesn’t work outside the main app in 5.2.0.rc2.
Instance Method Details
#variant(image, options) ⇒ Object
We wrap some Rails logic inside our own helper method because the resolve directive in ActiveStorage’s routes doesn’t work outside the main app in 5.2.0.rc2
7 8 9 10 11 12 13 14 |
# File 'app/helpers/spina/images_helper.rb', line 7 def variant(image, ) if image.attached? && image.variable? variant = image.variant() main_app.rails_blob_representation_path(variant.blob.signed_id, variant.variation.key, variant.blob.filename) else "https://placehold.it/100x100.png" end end |