From 471dadeaec756b3bab5c87de737b15e82acaf224 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 12 Jan 2024 14:11:15 +1100 Subject: [PATCH] Accept only image files Leaving the more specific validation in the Rails model (rather than try to duplicate it). --- app/views/admin/products_v3/_edit_image.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/products_v3/_edit_image.html.haml b/app/views/admin/products_v3/_edit_image.html.haml index 5c940979e4..7af268d64d 100644 --- a/app/views/admin/products_v3/_edit_image.html.haml +++ b/app/views/admin/products_v3/_edit_image.html.haml @@ -13,4 +13,4 @@ %input{ class: "secondary", type: 'button', value: t('.close'), "data-action": "click->modal#close" } -# label.button provides a handy shortcut to open the file selector on click. Unfortunately this trick isn't keyboard accessible though.. = f.label :attachment, t(".upload"), class: "button primary icon-upload-alt" - = f.file_field :attachment, style: "display: none", "data-action": "change->form#submit" + = f.file_field :attachment, accept: "image/*", style: "display: none", "data-action": "change->form#submit"