Open tcarion opened 3 years ago
Thanks for raising this issue. Unfortunately this is a complex issue which I haven't been able to solve in a long time. The solution atm is to use a view partial for anything more complex.
Ex:
<ul>
<% for_each(books) do book %>
<% partial("app/resources/books/views/_list_item.jl.html", book = book, context = @__MODULE__) %>
<% end %>
</ul>
The _list_item view partial has:
<li> 1. $(book.title) by $(book.author)</li>
<li> 2. $(book.title) by $(book.author)</li>
And the output:
Describe the bug When several sibling elements are to be rendered inside a
@foreach
loop, only the last sibling is actually rendered.Example :
Here only the second
div
will be rendered.Expected behavior All the sibling elements should be rendered.
Additional context Julia version:
Packages: