class ViewComponent::Collection
def components
def components return @components if defined? @components iterator = ActionView::PartialIteration.new(@collection.size) component.validate_collection_parameter!(validate_default: true) @components = @collection.map do |item| component.new(**component_options(item, iterator)).tap do |component| iterator.iterate! end end end