Class: Arara::DialogButtonComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::DialogButtonComponent
show all
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/dialog_button_component.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#default_data_controller, #default_html_tag, #html_class, #html_content, #html_tag, included
Constructor Details
8
9
10
11
12
|
# File 'app/components/arara/dialog_button_component.rb', line 8
def initialize(dialog_action:, **kw)
super(tag: "button", **kw)
@dialog_action = dialog_action
end
|
Instance Attribute Details
#dialog_action ⇒ Object
Returns the value of attribute dialog_action.
6
7
8
|
# File 'app/components/arara/dialog_button_component.rb', line 6
def dialog_action
@dialog_action
end
|
Instance Method Details
#default_html_class ⇒ Object
15
16
17
|
# File 'app/components/arara/dialog_button_component.rb', line 15
def default_html_class
"mdc-button mdc-dialog__button"
end
|
#html_data ⇒ Object
25
26
27
28
29
|
# File 'app/components/arara/dialog_button_component.rb', line 25
def html_data
data = super
data.merge!('mdc-dialog-action': dialog_action)
data
end
|
#html_options ⇒ Object
19
20
21
22
23
|
# File 'app/components/arara/dialog_button_component.rb', line 19
def html_options
opts = super
opts.merge!({type: "button"})
opts
end
|