From 798bb992dc41423b0241510d4614fb39ae7a609f Mon Sep 17 00:00:00 2001 From: f Date: Wed, 19 Jun 2024 18:20:05 -0300 Subject: [PATCH] feat: validar formularios htmx --- app/views/posts/_htmx_form.haml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/posts/_htmx_form.haml b/app/views/posts/_htmx_form.haml index f4f4a845..7a23445b 100644 --- a/app/views/posts/_htmx_form.haml +++ b/app/views/posts/_htmx_form.haml @@ -27,7 +27,12 @@ multipart: true, class: 'form post ', 'hx-swap': params.require(:swap), - 'hx-target': "##{params.require(:target)}" + 'hx-target': "##{params.require(:target)}", + 'hx-validate': true, + data: { + controller: 'form-validation', + action: 'form-validation#submit' + } } if post.new?