Class: RubyUI::BulkActionTableRow

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/ruby_cms/templates/components/ruby_ui/bulk_action_table/bulk_action_table_row.rb

Constant Summary

Constants inherited from Base

RubyUI::Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

#initialize(click_url: nil, cells: nil, **user_attrs) ⇒ BulkActionTableRow

Returns a new instance of BulkActionTableRow.



5
6
7
8
9
10
# File 'lib/generators/ruby_cms/templates/components/ruby_ui/bulk_action_table/bulk_action_table_row.rb', line 5

def initialize(click_url: nil, cells: nil, **user_attrs)
  @click_url = click_url
  @item_id = user_attrs.dig(:data, :item_id)
  @cells = cells
  super(**user_attrs)
end

Instance Method Details

#view_template(&block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/ruby_cms/templates/components/ruby_ui/bulk_action_table/bulk_action_table_row.rb', line 12

def view_template(&block)
  tr(**merged_attrs) do
    render_checkbox if should_render_checkbox?

    if @cells
      render_cells
    elsif block
      yield
    end
  end
end