I'm editing a feature that renders a ViewComponent.
After the ViewComponent is rendered, it's passed a block, which is the component itself
render SomeComponent.new(arg: foo) do |component|
component.with_items(some_items.map { |item| Hash }
end
There doesn't seem to be a tremendous amount of documentation for the #with_items method and I'm wondering:
is #with_items method a way to render slots inline?
I've done some simple and advanced Googling
I've reviewed the ViewComponent documentation (searching for "with_items" only points to a single test case situation using with_item...singular)
I've searched the Github repo for ViewComponent and saw some allusion to the method, though it wasn't much help to me.
It appears to be an inline way to pass items to the template and or object without explicitly defining a slot with renders_many, though that's just my expectation.