5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-29 15:56:21 +00:00
panel/app/views/bootstrap/_btn.haml

13 lines
479 B
Text
Raw Normal View History

2024-05-17 18:17:47 +00:00
-#
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