Sha256: ff91ebfbd152d77ca975b897caf18faa2bc9708d56a382748e008c3edde5176b
Contents?: true
Size: 877 Bytes
Versions: 11
Compression:
Stored size: 877 Bytes
Contents
# frozen_string_literal: true module Katalyst module Tables class BodyRowComponent < ViewComponent::Base # :nodoc: include HasHtmlAttributes renders_many :columns, ->(component) { component } def initialize(table, record) super() @table = table @record = record end def call content # generate content before rendering tag.tr(**html_attributes) do columns.each do |column| concat(column.to_s) end end end def cell(attribute, **options, &block) with_column(@table.body_cell_component.new(@table, @record, attribute, **options), &block) end def header? false end def body? true end def inspect "#<#{self.class.name} record: #{record.inspect}>" end end end end
Version data entries
11 entries across 11 versions & 1 rubygems