Rails link_to 具有超棒的字体和外部 url
Rails link_to with font-awesome and external url
我正在尝试 link 到 rails 应用程序中的 youtube 页面,字体很棒 gem。
<i><%= link_to fa_icon "youtube-square 2x", @book.youtube %></i>
这样做时,我收到 no implicit conversion of Symbol into String
错误消息。
我是否需要删除 font-awesome helper 并将其作为 class 包含,或者是否有其他方法可以使其协同工作?
Looking at the docs,我认为您需要将 fa_icon
助手放在 link_to
块中:
<%= link_to @book.youtube do %>
<%= fa_icon "youtube-square 2x" %>
<% end %>
我正在尝试 link 到 rails 应用程序中的 youtube 页面,字体很棒 gem。
<i><%= link_to fa_icon "youtube-square 2x", @book.youtube %></i>
这样做时,我收到 no implicit conversion of Symbol into String
错误消息。
我是否需要删除 font-awesome helper 并将其作为 class 包含,或者是否有其他方法可以使其协同工作?
Looking at the docs,我认为您需要将 fa_icon
助手放在 link_to
块中:
<%= link_to @book.youtube do %>
<%= fa_icon "youtube-square 2x" %>
<% end %>