<%= link adding icon (font-awesome) no longer works?

This used to work and no longer. Could use help with adding the icon element (won’t show in this post for some reason)

<%= link “Show”, to: Routes.account_path(@conn, :show, account) do %>
#add icon element here
<% end %>

error keeps coming back … undefined function link/3
Thanks in advance…

If you use link with do...end you need to place the link content inside the do...end, something like the following:

<%= link to: Routes.account_path(@conn, :show, account) do %>
  Show <add icon element here> # <- icon to the right of "Show"
<% end %>
# OR
<%= link to: Routes.account_path(@conn, :show, account) do %>
  <add icon element here> Show # <- icon to the left of "Show"
<% end %>
1 Like

Thanks very much - that worked.

1 Like