Sha256: 28a76cad3a02987ac56e8cd1af72140593c58af0c752fe7c76c38d532e0c0354

Contents?: true

Size: 399 Bytes

Versions: 8

Compression:

Stored size: 399 Bytes

Contents

# frozen_string_literal: true

module Koi
  module Tables
    # Custom body cell component, in order to override the content
    class BodyCellComponent < Katalyst::Tables::BodyCellComponent
      def before_render
        # fallback if no content block is given
        with_content(rendered_value) unless content?
      end

      def rendered_value
        value.to_s
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
katalyst-koi-4.5.5 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.4 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.3 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.2 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.1 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.0 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.0.beta.2 app/components/koi/tables/body_cell_component.rb
katalyst-koi-4.5.0.beta.1 app/components/koi/tables/body_cell_component.rb