How to use "_blank" or "_new" in Rails
ruby, ruby-on-rails, ruby-on-rails-3
Solution
I think it's like this
<%= link_to image_tag('img.png'), 'http://www.website.com', target: '_blank' %>
See http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
Problem
In HTML, if I wanted a link to open in a new window, I'd adopt target="_blank" like this: ``` <a href="http://www.website.com/" target="_blank"><img src="/img.png" /></a> ``` How do I add the "_blank" to rails? Here's the code I so far for the link (but it currently opens in the same tab/window): ``` <%= link_to image_tag("img.png"), 'http://www.website.com/' %> ```