correctif(a11y): il est recommandé d'utilser un boutton pour la suppression d'un element. le bouton etant deja dans un form, nous ne pouvons pas utiliser le button_to. Extraction d'un form pour soumettre la suppression des pjs par des input pointant sur ce form
Update app/components/attachment/edit_component/edit_component.html.haml Co-authored-by: Paul Chavard <github@paul.chavard.net> Update app/views/shared/dossiers/_edit.html.haml Co-authored-by: Paul Chavard <github@paul.chavard.net> amelioration(attachment.destroy): force l'usage de turbo
This commit is contained in:
parent
64565857e4
commit
eca44ce60e
4 changed files with 14 additions and 5 deletions
|
@ -10,6 +10,10 @@
|
|||
- else
|
||||
- form_options = { url: modifier_dossier_url(dossier), method: :patch }
|
||||
|
||||
%div
|
||||
= form_tag('/attachments/:id', method: :delete, data: { 'turbo-method': :delete, turbo: true }, id: dom_id(ActiveStorage::Attachment.new, :delete)) do
|
||||
-# otherwise the closing tag bugs
|
||||
|
||||
= form_for dossier, form_options.merge({ html: { id: 'dossier-edit-form', class: 'form', multipart: true, novalidate: 'novalidate' } }) do |f|
|
||||
|
||||
%header.mb-6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue