Class: RubyUIAdmin::Views::Index
- Includes:
- ActionsMenu
- Defined in:
- app/components/ruby_ui_admin/views/index.rb
Constant Summary collapse
- BULK_FORM_ID =
"rua-bulk-form"
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(resource:, records:, pagy:, filters: [], filter_values: {}, scopes: [], current_scope_key: nil, scope_param: nil, remove_scope_all: false, query_params: {}, sort_by: nil, sort_direction: nil) ⇒ Index
constructor
A new instance of Index.
- #page_title ⇒ Object
Methods included from ActionsMenu
Methods inherited from Base
#authorized_to?, #view_template
Methods included from Translation
Methods included from PathHelpers
#attachment_url, #resource_edit_path, #resource_index_path, #resource_new_path, #resource_show_path
Constructor Details
#initialize(resource:, records:, pagy:, filters: [], filter_values: {}, scopes: [], current_scope_key: nil, scope_param: nil, remove_scope_all: false, query_params: {}, sort_by: nil, sort_direction: nil) ⇒ Index
Returns a new instance of Index.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/components/ruby_ui_admin/views/index.rb', line 8 def initialize(resource:, records:, pagy:, filters: [], filter_values: {}, scopes: [], current_scope_key: nil, scope_param: nil, remove_scope_all: false, query_params: {}, sort_by: nil, sort_direction: nil) @resource = resource @records = records @pagy = pagy @filters = filters @filter_values = filter_values @scopes = scopes @current_scope_key = current_scope_key @scope_param = scope_param @remove_scope_all = remove_scope_all @query_params = query_params @sort_by = sort_by @sort_direction = sort_direction end |
Instance Method Details
#content ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/components/ruby_ui_admin/views/index.rb', line 29 def content render_header render_scope_tabs # The `rua--bulk-select` controller (select-all + checked-ids) scopes to this table card. card_attrs = {class: "p-4"} card_attrs[:data] = {controller: "rua--bulk-select"} if bulk? render RubyUI::Card.new(**card_attrs) do render_table end render_pagination end |
#page_title ⇒ Object
23 24 25 |
# File 'app/components/ruby_ui_admin/views/index.rb', line 23 def page_title "#{@resource.} ยท #{RubyUIAdmin.configuration.app_name}" end |