Class: Superform::Rails::Components::ButtonComponent
Instance Attribute Summary
#dom, #field
Instance Method Summary
collapse
#focus, #initialize
Instance Method Details
#button_text ⇒ Object
250
251
252
|
# File 'lib/superform/rails.rb', line 250
def button_text
@attributes.fetch(:value, dom.value).titleize
end
|
#field_attributes ⇒ Object
254
255
256
|
# File 'lib/superform/rails.rb', line 254
def field_attributes
{ id: dom.id, name: dom.name, value: dom.value }
end
|
#template(&content) ⇒ Object
245
246
247
248
|
# File 'lib/superform/rails.rb', line 245
def template(&content)
content ||= Proc.new { button_text }
button(**attributes, &content)
end
|