Sha256: cd0c1ac417d758267de8f6388692d5394c0cb92753b8dda8696d1d54ccfa4792
Contents?: true
Size: 980 Bytes
Versions: 7
Compression:
Stored size: 980 Bytes
Contents
# frozen_string_literal: true module Katalyst module Tables class BodyRowComponent < ViewComponent::Base # :nodoc: include Katalyst::HtmlAttributes 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 # Backwards compatibility with tables 1.0 alias_method :options, :html_attributes= end end end
Version data entries
7 entries across 7 versions & 1 rubygems