From 76de2e543e1cc0562937e89545c2e57909481e31 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 17 May 2024 15:17:47 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20un=20bot=C3=B3n=20accionable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bootstrap/_btn.haml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/views/bootstrap/_btn.haml diff --git a/app/views/bootstrap/_btn.haml b/app/views/bootstrap/_btn.haml new file mode 100644 index 00000000..22f60b3e --- /dev/null +++ b/app/views/bootstrap/_btn.haml @@ -0,0 +1,12 @@ +-# + Un botón + + @param :content [String] Contenido + @param :action [String] Acción de Stimulus + @param :target [String] Objetivo de Stimulus + @param [Hash] Atributos en bruto, con mayor prioridad que action y target +- attributes = local_assigns.to_h.except(:content) +- attributes[:data] ||= {} +- attributes[:data][:action] ||= local_assigns[:action] +- attributes[:data][:target] ||= local_assigns[:target] +%button.btn.btn-secondary{ type: 'button', **attributes }= content