Class: Pageflow::Admin::EmbeddedIndexTable Private
- Inherits:
-
ViewComponent
- Object
- Arbre::Component
- ViewComponent
- Pageflow::Admin::EmbeddedIndexTable
- Defined in:
- app/views/components/pageflow/admin/embedded_index_table.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: SortColumnRecorder
Instance Attribute Summary collapse
- #base_collection ⇒ Object readonly private
- #scopes ⇒ Object readonly private
Instance Method Summary collapse
- #build(base_collection, options = {}) ⇒ Object private
- #scope(*args) ⇒ Object private
- #table_for_collection(options = {}) ⇒ Object private
Instance Attribute Details
#base_collection ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 7 def base_collection @base_collection end |
#scopes ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 7 def scopes @scopes end |
Instance Method Details
#build(base_collection, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 12 13 14 15 16 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 9 def build(base_collection, = {}) @base_collection = base_collection @scopes = [] @sort_columns = [] @blank_slate_text = [:blank_slate_text] @model = [:model] super() end |
#scope(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 23 24 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 18 def scope(*args) = args. title = args[0] method = args[1] [:localizer] ||= ActiveAdmin::Localizers::ResourceLocalizer.new(@model&.model_name) scopes << ActiveAdmin::Scope.new(title, method, ) end |
#table_for_collection(options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 26 def table_for_collection( = {}, &) custom_scopes_renderer(scopes, default_scope: scopes.first.id) if scopes.any? record_sort_columns(&) if [:sortable] if scoped_collection.any? build_table(, &) else build_blank_slate end end |