Im trying to figure out how to make a link in my show page.
I want a link to
<%= @project.external_link %>.
I want to display it as:
<%= link_to '<i class="fa fa-link"></i>' %>
I've tried at least 20 variations on combining these two and I can't find a way that works.
Does anyone know how to display a font awesome icon, with a link to a dynamic field?
Try this:
<%= link_to @project.external_link do %>
<i class="fa fa-link"></i>
<% end %>
尝试使用:
<a href="<%= @project.external_link%>"><i class="fa fa-link"></i></a>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.