Sha256: 16354af8544de0134dbb01c9ca04b0d7d91a8b35b235ee9dd1abcc8942526cfe
Contents?: true
Size: 847 Bytes
Versions: 26
Compression:
Stored size: 847 Bytes
Contents
# frozen_string_literal: true module Katalyst module Tables class EmptyCaptionComponent < ViewComponent::Base # :nodoc: include Katalyst::HtmlAttributes def initialize(table, **html_attributes) super(**html_attributes) @table = table end def render? @table.collection.empty? end def filtered? @table.collection.respond_to?(:filtered?) && @table.collection.filtered? end def clear_filters_path url_for end def plural_human_model_name human = @table.model_name&.human || @table.object_name&.to_s&.humanize || "record" human.pluralize.downcase end def inspect "#<#{self.class.name}>" end private def default_html_attributes { align: "bottom" } end end end end
Version data entries
26 entries across 26 versions & 1 rubygems