简体   繁体   中英

Remove <a> tag from rails “link_to” methdo

I need to remove <a> tag from rails link_to method. 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') %>

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM