Class: Pageflow::Admin::EmbeddedIndexTable
- Inherits:
-
ViewComponent
- Object
- Arbre::Component
- ViewComponent
- Pageflow::Admin::EmbeddedIndexTable
- Defined in:
- app/views/components/pageflow/admin/embedded_index_table.rb
Instance Attribute Summary collapse
-
#base_collection ⇒ Object
readonly
Returns the value of attribute base_collection.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
Instance Method Summary collapse
- #build(base_collection, options = {}) ⇒ Object
- #scope(*args) ⇒ Object
- #table_for_collection(*args, &block) ⇒ Object
Methods inherited from ViewComponent
Instance Attribute Details
#base_collection ⇒ Object (readonly)
Returns the value of attribute base_collection.
6 7 8 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 6 def base_collection @base_collection end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
6 7 8 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 6 def scopes @scopes end |
Instance Method Details
#build(base_collection, options = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 8 def build(base_collection, = {}) @base_collection = base_collection @scopes = [] @blank_slate_text = [:blank_slate_text] super() end |
#scope(*args) ⇒ Object
15 16 17 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 15 def scope(*args) scopes << ActiveAdmin::Scope.new(*args) end |
#table_for_collection(*args, &block) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/views/components/pageflow/admin/embedded_index_table.rb', line 19 def table_for_collection(*args, &block) if scopes.any? custom_scopes_renderer(scopes, :default_scope => scopes.first.id) end if scoped_collection.any? build_table(*args, &block) else build_blank_slate end end |