From 6586f18cfbf5d29fc11d30528b35244cb76871f4 Mon Sep 17 00:00:00 2001 From: markmead Date: Fri, 14 Aug 2020 21:24:13 +0100 Subject: [PATCH] Allow for HTML options on image partial --- frontend/app/views/spree/shared/_image.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app/views/spree/shared/_image.html.erb b/frontend/app/views/spree/shared/_image.html.erb index d7d4a970951..794ad0f7321 100644 --- a/frontend/app/views/spree/shared/_image.html.erb +++ b/frontend/app/views/spree/shared/_image.html.erb @@ -1,11 +1,12 @@ <% size ||= :mini %> <% itemprop ||= nil %> +<% options ||= {} %> <% if image_url = image.try(:url, size) %> <% if image_alt = image.try(:alt) %> - <%= image_tag image_url, alt: image_alt, itemprop: itemprop %> + <%= image_tag image_url, { alt: image_alt, itemprop: itemprop }.merge(options) %> <% else %> - <%= image_tag image_url, itemprop: itemprop %> + <%= image_tag image_url, { itemprop: itemprop }.merge(options) %> <% end %> <% else %>