# Code open the external links in new tab, or new window

**URL:** <https://www.ruby-forum.com/t/code-open-the-external-links-in-new-tab-or-new-window/165218>\
**Category:** Rails\
**Created:** [April 10, 2009, 9:58am UTC](https://www.ruby-forum.com/t/code-open-the-external-links-in-new-tab-or-new-window/165218 "2009-04-10T09:58:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![santoshturamari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@santoshturamari](https://www.ruby-forum.com/u/santoshturamari)\
**Post date:** [April 10, 2009, 9:58am UTC](https://www.ruby-forum.com/t/code-open-the-external-links-in-new-tab-or-new-window/165218/1 "2009-04-10T09:58:20Z")

</div>

Hi all,  
I have a problem to open an add in my app in new tab, it is opening in  
the same tab of my site.

in my view I have added  
\<%= show\_industry\_sponsor(@community.industry) %\>

and in application\_helper.rb  
def show\_industry\_sponsor(industry)

```
 return "<a href='http://www.someurl.com'

```

onclick=‘window.open(this.href,’\_blank’);return false;’ \>"

end

please help me out… its urgent.
