Class: Anchor::TableComponent
- Includes:
- Pagination
- Defined in:
- app/components/anchor/table_component.rb
Defined Under Namespace
Classes: ColumnComponent
Constant Summary
Constants included from Pagination
Pagination::INITIAL_PAGE, Pagination::PER_PAGE_DEFAULT, Pagination::QUERY_PARAM
Constants included from ViewHelper
Instance Attribute Summary collapse
-
#caption ⇒ Object
readonly
Returns the value of attribute caption.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#paginate ⇒ Object
readonly
Returns the value of attribute paginate.
-
#row_classes ⇒ Object
readonly
Returns the value of attribute row_classes.
-
#rows_link_to ⇒ Object
readonly
Returns the value of attribute rows_link_to.
-
#sortable ⇒ Object
readonly
Returns the value of attribute sortable.
Instance Method Summary collapse
-
#initialize(data:, caption: nil, empty_message: nil, row_classes: nil, rows_link_to: nil, sort_url: nil, sortable: false, paginate: false, **kwargs) ⇒ TableComponent
constructor
A new instance of TableComponent.
Methods included from Pagination
#page, #paginated_data, #per_page, #position
Methods inherited from Component
Methods included from ViewHelper
#anchor_form_with, #anchor_svg, #deep_blank?, #merge_options, #popover_trigger_attributes
Methods included from FetchOrFallbackHelper
Constructor Details
#initialize(data:, caption: nil, empty_message: nil, row_classes: nil, rows_link_to: nil, sort_url: nil, sortable: false, paginate: false, **kwargs) ⇒ TableComponent
Returns a new instance of TableComponent.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/components/anchor/table_component.rb', line 16 def initialize( data:, caption: nil, empty_message: nil, row_classes: nil, rows_link_to: nil, sort_url: nil, sortable: false, paginate: false, **kwargs ) @data = data @empty_message = @rows_link_to = rows_link_to @row_classes = row_classes @sortable = sortable @sort_url = sort_url @caption = @paginate = paginate super(**kwargs) end |
Instance Attribute Details
#caption ⇒ Object (readonly)
Returns the value of attribute caption.
7 8 9 |
# File 'app/components/anchor/table_component.rb', line 7 def @caption end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'app/components/anchor/table_component.rb', line 7 def data @data end |
#paginate ⇒ Object (readonly)
Returns the value of attribute paginate.
7 8 9 |
# File 'app/components/anchor/table_component.rb', line 7 def paginate @paginate end |
#row_classes ⇒ Object (readonly)
Returns the value of attribute row_classes.
7 8 9 |
# File 'app/components/anchor/table_component.rb', line 7 def row_classes @row_classes end |
#rows_link_to ⇒ Object (readonly)
Returns the value of attribute rows_link_to.
7 8 9 |
# File 'app/components/anchor/table_component.rb', line 7 def rows_link_to @rows_link_to end |
#sortable ⇒ Object (readonly)
Returns the value of attribute sortable.
7 8 9 |
# File 'app/components/anchor/table_component.rb', line 7 def sortable @sortable end |