Class: RubyCms::Admin::BulkActionTable::BulkActionTableRow

Inherits:
RubyCms::Admin::BaseComponent show all
Defined in:
app/components/ruby_cms/admin/bulk_action_table/bulk_action_table_row.rb

Overview

Table row component Individual table row with clickable support and checkbox

Instance Method Summary collapse

Methods inherited from RubyCms::Admin::BaseComponent

#build_classes, #conditional_attributes, #controller, #form_authenticity_token, #helpers, #merge_data_attributes, #token_from_controller, #token_from_controller?, #token_from_helpers?

Constructor Details

#initialize(click_url: nil, data: {}, cells: nil, bulk_actions_enabled: true, controller_name: "ruby-cms--bulk-action-table", class: nil, **user_attrs) ⇒ BulkActionTableRow



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/components/ruby_cms/admin/bulk_action_table/bulk_action_table_row.rb', line 16

def initialize(
  click_url: nil,
  data: {},
  cells: nil,
  bulk_actions_enabled: true,
  controller_name: "ruby-cms--bulk-action-table",
  class: nil,
  **user_attrs
)
  super
  @click_url = click_url
  @data = data || {}
  @cells = cells
  @bulk_actions_enabled = bulk_actions_enabled
  @controller_name = controller_name
  @row_class = binding.local_variable_get(:class)
  @user_attrs = user_attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



35
36
37
38
39
40
# File 'app/components/ruby_cms/admin/bulk_action_table/bulk_action_table_row.rb', line 35

def view_template(&block)
  tr(**row_attributes) do
    render_bulk_checkbox
    render_cells_or_block(&block)
  end
end