This is not possible to do directly from the controller. Using redirect_to @url
has the effect of opening an URL in the same "window", as it simply sends a HTTP redirect instruction back to the browser. redirect_to
is not capable of opening new windows. The controller resides on the server side, and opening a new window belongs to the client side.
Some options:
a) render a link with <%= link_to 'Google', 'google.com', :target => '_blank' %>
or <a href="google.com" target="_blank">Google</a>
which the user can click on in a new view
b) use JavaScript to open the link automatically, but beware that browsers may treat this as a popup and block it
By combining these options you can open links in new window for browsers/users who allow it, and fall back to a regular URL in case that didn't work.