Html tag inside Enum.each not printed

view.html.eex :

<% Enum.each @account_types, fn(item) -> %>
    <option value="<%= item.key %>"><%= item.name %></option>
<% end %>

<%= IO.puts(@data) %> [output](http://pastecode.xyz/view/raw/9578ffc5](pastecode.xyz/view/raw/9578ffc5)

but option tag is not printed in html output

Enum.each/2 doesn’t return anything, so there is nothing to be printed.

Use Enum.map/2 and change the <% to a <%=

5 Likes