mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 23:06:22 +00:00
13 lines
485 B
Text
13 lines
485 B
Text
-#
|
|
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
|
|
:ruby
|
|
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
|