[英]Remove <a> tag from rails “link_to” methdo
I need to remove <a>
tag from rails link_to
method. 我需要从rails link_to
方法中删除<a>
标记。 Here is current code and result: 这是当前代码和结果:
<%= link_to "ESP", :locale=>'es'%>
<a href="/es/blog/crazy_page">ESP</p>
Here is my desired outcome: 这是我想要的结果:
/es/blog/crazy_page
Reason I need this is so I could make "alternate" link tag in header for each language. 我之所以需要这样做,是因为我可以在每种语言的标头中添加“替代”链接标记。 Can't seem to find this anywhere. 似乎在任何地方都找不到。
使用url_for
方法
<%= url_for(:locale => 'es') %>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.