Sha256: ef796210dbd3874532b8d2768212c61b72c62887b745d67961518d42b5eb275a
Contents?: true
Size: 603 Bytes
Versions: 12
Compression:
Stored size: 603 Bytes
Contents
module ExpressUi class UnorderedList < ExpressTemplates::Container include ExpressTemplates::Components::Capabilities::Iteration tag :ul has_option :collection_name, "Optional name for the collection if different from the :id" contains -> (&block) { for_all(collection_name) { li(id: item_id, class: singular_item_name) { block.call() } } } def collection_name config[:collection_name] || config[:id] end def item_id if item.respond_to?(:id) "#{singular_item_name}:#{item.id}" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems