DanielsV DanielsV -4 years ago 85
HTML Question

Remove <a> tag from rails "link_to" methdo

I need to remove

tag from rails
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:


Reason I need this is so I could make "alternate" link tag in header for each language. Can't seem to find this anywhere.

Answer Source

Use url_for method

<%= url_for(:locale => 'es') %>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download