0
<%= link_to StackOverflow, 'https://stackoverflow.com/',  :target => '_blank' %>

How do I make a link that opens in a new background tab? The above code opens the link of StackOverflow in a foreground tab.

Thanks in advance

UPDATE:

I found an answer from another question

$('a[target="_blank"]').removeAttr('target');

How to do it in Ruby/Rails?

Community
  • 1
  • 1
Jez
  • 305
  • 2
  • 12
  • Similar question here: http://stackoverflow.com/questions/4086988/how-do-i-make-link-to-open-external-urls-in-a-new-window – Benjamin Tan Wei Hao Oct 28 '12 at 08:34
  • It's more similar to this http://stackoverflow.com/questions/498530/open-a-new-tab-in-firefox-and-keep-ff-in-the-background?rq=1 How do I do that the Ruby/Rails way?.. :) – Jez Oct 29 '12 at 05:17

1 Answers1

0
<%= link_to StackOverflow, 'http://stackoverflow.com/',  :target => 'new' %>
WispyCloud
  • 4,140
  • 1
  • 28
  • 31