mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:16:21 +00:00
feat: un botón accionable
This commit is contained in:
parent
7dbe12ed66
commit
76de2e543e
1 changed files with 12 additions and 0 deletions
12
app/views/bootstrap/_btn.haml
Normal file
12
app/views/bootstrap/_btn.haml
Normal file
|
@ -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
|
Loading…
Reference in a new issue