Module: Koi::Tables::Cells
- Included in:
- SummaryTableComponent, Koi::TableComponent
- Defined in:
- app/components/concerns/koi/tables/cells.rb,
app/components/koi/tables/cells/link_component.rb,
app/components/koi/tables/cells/attachment_component.rb
Defined Under Namespace
Classes: AttachmentComponent, LinkComponent
Instance Method Summary collapse
-
#attachment(column, label: nil, heading: false, variant: :thumb) {|cell| ... } ⇒ void
Generates a column that renders an ActiveStorage attachment as a downloadable link.
-
#link(column, label: nil, heading: false, url: (default_url = true), link: {}) {|cell| ... } ⇒ void
Generates a column that links to the record’s show page (by default).
Instance Method Details
#attachment(column, label: nil, heading: false, variant: :thumb) {|cell| ... } ⇒ void
This method returns an undefined value.
Generates a column that renders an ActiveStorage attachment as a downloadable link.
If a block is provided, it will be called with the attachment cell component as an argument.
50 51 52 53 54 |
# File 'app/components/concerns/koi/tables/cells.rb', line 50 def (column, label: nil, heading: false, variant: :thumb, **, &) with_cell(Tables::Cells::AttachmentComponent.new( collection:, row:, column:, record:, label:, heading:, variant:, **, ), &) end |
#link(column, label: nil, heading: false, url: (default_url = true), link: {}) {|cell| ... } ⇒ void
This method returns an undefined value.
Generates a column that links to the record’s show page (by default).
If a block is provided, it will be called with the link cell component as an argument.
28 29 30 31 32 |
# File 'app/components/concerns/koi/tables/cells.rb', line 28 def link(column, label: nil, heading: false, url: (default_url = true), link: {}, **, &) with_cell(Tables::Cells::LinkComponent.new( collection:, row:, column:, record:, label:, heading:, url:, default_url:, link:, **, ), &) end |