Class: RubyUI::BulkActions

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/ruby_cms/templates/components/ruby_ui/bulk_action_table/bulk_actions.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(url: nil, item_name: "item", buttons: [], controller_name: "ruby-ui--bulk-action-table", **user_attrs) ⇒ BulkActions

Returns a new instance of BulkActions.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/ruby_cms/templates/components/ruby_ui/bulk_action_table/bulk_actions.rb', line 5

def initialize(
  url: nil,
  item_name: "item",
  buttons: [],
  controller_name: "ruby-ui--bulk-action-table",
  **user_attrs
)
  @url = url
  @item_name = item_name
  @action_buttons = Array(buttons)
  @controller_name = controller_name
  super(**user_attrs)
end

Instance Method Details

#view_templateObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/generators/ruby_cms/templates/components/ruby_ui/bulk_action_table/bulk_actions.rb', line 19

def view_template
  div(**attrs) do
    div(class: "flex items-center justify-between gap-4 max-w-full") do
      render_selection_info
      div(class: "flex items-center gap-2") do
        render_buttons
        render_delete
      end
    end
  end
end