Class: RubyUI::DataTableExpandToggle
- Defined in:
- lib/ruby_ui/data_table/data_table_expand_toggle.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(controls:, expanded: false, label: "Toggle row details", **attrs) ⇒ DataTableExpandToggle
constructor
A new instance of DataTableExpandToggle.
- #view_template ⇒ Object
Constructor Details
#initialize(controls:, expanded: false, label: "Toggle row details", **attrs) ⇒ DataTableExpandToggle
Returns a new instance of DataTableExpandToggle.
5 6 7 8 9 10 |
# File 'lib/ruby_ui/data_table/data_table_expand_toggle.rb', line 5 def initialize(controls:, expanded: false, label: "Toggle row details", **attrs) @controls = controls @expanded = @label = label super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ruby_ui/data_table/data_table_expand_toggle.rb', line 12 def view_template ( type: "button", aria_expanded: @expanded.to_s, aria_controls: @controls, aria_label: @label, data: { action: "click->ruby-ui--data-table#toggleRowDetail" }, **attrs ) do render_icon end end |