From b1de64bf3eed236b07fbe9b9ce1e6de57807bc67 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 9 Jun 2023 11:05:44 +0100 Subject: [PATCH] Remove unnecessary iterator (cherry picked from commit 15000c7ed188e4f47dc417f2098624d7735f5d1f) --- app/views/spree/admin/images/index.html.haml | 24 +++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/app/views/spree/admin/images/index.html.haml b/app/views/spree/admin/images/index.html.haml index 5839dd10e1..6561e17810 100644 --- a/app/views/spree/admin/images/index.html.haml +++ b/app/views/spree/admin/images/index.html.haml @@ -25,16 +25,14 @@ %th= t('spree.alt_text') %th.actions %tbody - - ([@product.image]).each do |image| - - tr_class = cycle('odd', 'even') - - tr_id = spree_dom_id(image) - %tr{class: tr_class, id: tr_id } - %td.no-border - %span.handle - %td - = link_to image_tag(image.url(:mini)), image.url(:product) - %td= options_text_for(image) - %td= image.alt - %td.actions - = link_to_with_icon 'icon-edit', t('spree.edit'), edit_admin_product_image_url(@product, image, @url_filters), no_text: true, data: { action: 'edit'} - = link_to_delete image, { url: admin_product_image_url(@product, image, @url_filters), no_text: true } + - image = @product.image + %tr{id: spree_dom_id(image) } + %td.no-border + %span.handle + %td + = link_to image_tag(image.url(:mini)), image.url(:product) + %td= options_text_for(image) + %td= image.alt + %td.actions + = link_to_with_icon 'icon-edit', t('spree.edit'), edit_admin_product_image_url(@product, image, @url_filters), no_text: true, data: { action: 'edit'} + = link_to_delete image, { url: admin_product_image_url(@product, image, @url_filters), no_text: true }