Rails: How to use “_blank” or “_new” in Rails

后端 未结 4 948
再見小時候
再見小時候 2020-12-16 12:43

In HTML, if I wanted a link to open in a new window, I\'d adopt target=\"_blank\" like this:



        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 13:36

    For anyone wondering how to achieve this when passing a block:

    <%= link_to(product.link, target: '_blank') do %>

提交回复
热议问题