I have code in an html.eex file that needs to render a series of links and I'm using this code currently,
<%= for item <- @links do %>
<%= link(item, to: URI.parse(item))%>
<% end %>
However when this renders it just to an email it just puts it an tag with no href attached like <a> https://example.com </a>
How do a I get the href portion setup correctly so the link can be clickable?
I am looking at https://hexdocs.pm/phoenix_html/Phoenix.HTML.Link.html#link/2 to base my code off of.
You can still use standard
<a class="tailwind for example" href={URI.parse(item)}>click me</a>
tag or add class to your link which is missing from your example to become clickable.
link("<hello>", to: "/world", class: "btn")
will generate
#=> <a class="btn" href="/world"><hello></a>
the second is an example from the docs.