Aaron Aaron - 1 year ago 91
HTML Question

Rails: Open link in a new page

I was wondering a way to open a link in a new tab. Here is the code I have so far:

<li><%= link_to "Pictures", pictures_path %></li>

I have researched ways to do this with
, but for some reason when I tried it, it did not work. Any help is greatly appreciated!

gen gen
Answer Source

Try it like this:

<li><%= link_to "Pictures", pictures_path, target: :_blank %></li>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download