From 33af3bae65ad21eb7844aed0cfa036296abe7520 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Wed, 17 Jan 2024 18:10:48 +1030 Subject: [PATCH 1/2] Update icons_helper.rb to render alt tag --- app/helpers/icons_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 511e2b352..768d179c9 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -93,7 +93,7 @@ module IconsHelper def plant_part_icon(name) if File.exist? Rails.root.join('app', 'assets', 'images', 'icons', 'plant_parts', "#{name}.svg") - image_tag "icons/plant_parts/#{name}.svg", class: 'img img-icon', 'aria-hidden' => "true" + image_tag "icons/plant_parts/#{name}.svg", class: 'img img-icon', 'aria-hidden' => "true", alt: name else planting_icon end From a118a95b5407f215b8a746b9d41fc55377f9b581 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Wed, 17 Jan 2024 18:12:58 +1030 Subject: [PATCH 2/2] Update icons_helper.rb --- app/helpers/icons_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 768d179c9..61d44c90d 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -101,7 +101,7 @@ module IconsHelper def crop_icon(crop) if crop.svg_icon.present? - image_tag(crop_path(crop, format: 'svg'), class: 'crop-icon') + image_tag(crop_path(crop, format: 'svg'), class: 'crop-icon', alt: crop) elsif crop.parent.present? crop_icon(crop.parent) else @@ -123,6 +123,6 @@ module IconsHelper end def image_icon(icon) - image_tag "icons/#{icon}.svg", class: 'img img-icon', 'aria-hidden' => "true" + image_tag "icons/#{icon}.svg", class: 'img img-icon', 'aria-hidden' => "true", alt: icon end end