This is a suggestion for a slightly different API that would allow 1) capture HTML even when you have no elements and b) support any number of nested elements.
Scenario 1: No elements
<%= component "card" do %>
foo
<% end %>
component.value == "foo"
Scenario 2: Single element
<%= component "card" do |c| %>
<% c.header "foo" %>
<% end %>
This is a suggestion for a slightly different API that would allow 1) capture HTML even when you have no elements and b) support any number of nested elements.
Scenario 1: No elements
Scenario 2: Single element
Scenario 3: Nested element
Scenario 4: Nested element + element value