Sha256: 9c9b26c7208df7bbc5bd39e5b122c454ba0b8f72e1a72eb277abec9d50bb4729
Contents?: true
Size: 563 Bytes
Versions: 13
Compression:
Stored size: 563 Bytes
Contents
# frozen_string_literal: true module Katalyst module Tables module Cells # Displays an enum value using data inferred from the model. class EnumComponent < CellComponent def rendered_value if (value = self.value).present? label = collection.model.human_attribute_name("#{column}.#{value}") content_tag(:small, label, data: { enum: column, value: }) end end private def default_html_attributes { class: "type-enum" } end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems