Sha256: 14c8493ce143e8bdef1b1a7baff49fa07cae91e5b0df4388dc1f5e754e4e88ee
Contents?: true
Size: 623 Bytes
Versions: 3
Compression:
Stored size: 623 Bytes
Contents
# frozen_string_literal: true module Katalyst module Tables # View Helper for generating HTML tables. Include in your ApplicationHelper, or similar. module Frontend def table_with(collection:, component: nil, **options, &block) component ||= default_table_component_class render(component.new(collection: collection, **options), &block) end private def default_table_component_class component = controller.try(:default_table_component) || TableComponent component.respond_to?(:constantize) ? component.constantize : component end end end end
Version data entries
3 entries across 3 versions & 1 rubygems