将link_与i18n和glyphicon、Ruby-on-Rails一起使用
我不知道如何使用链接来正确处理国际化标记和字形图标 我的代码目前看起来像这样将link_与i18n和glyphicon、Ruby-on-Rails一起使用,ruby,internationalization,Ruby,Internationalization,我不知道如何使用链接来正确处理国际化标记和字形图标 我的代码目前看起来像这样 <%=link_to t('health_info.twitter_posts_featuredacc')+' <i class="fa fa-twitter"></i>'.html_safe, health_info_tweets_path(type: 'featured') %> 它提取正确的翻译,但它也会将“.html”中的所有内容显示为正常的html代码,而不是字形图标
<%=link_to t('health_info.twitter_posts_featuredacc')+' <i class="fa fa-twitter"></i>'.html_safe, health_info_tweets_path(type: 'featured') %>
它提取正确的翻译,但它也会将“.html”中的所有内容显示为正常的html代码,而不是字形图标
提前感谢。我将使用块语法:
<%= link_to(health_info_tweets_path(type: 'featured')) do %>
<%= t('health_info.twitter_posts_featuredacc') %>
<i class="fa fa-twitter"></i>
<% end %>
我正要回答,但在回答的前5分钟内我没能做到。你回答得太快了。:)投票和接受已经完成。再次感谢。