<li class="li_spacing"><%= button_to "Website", @restaurant.website, :target => '_blank', :class => "btn btn-primary" %></li>
Everything works except for :target => '_blank'. Why does this not render the the link in a new page?
%= button_to "Website", @restaurant.website, :target => '_blank', :class => "btn btn-primary" %> Everything works except " /> <%= button_to "Website", @restaurant.website, :target => '_blank', :class => "btn btn-primary" %> Everything works except " /> <%= button_to "Website", @restaurant.website, :target => '_blank', :class => "btn btn-primary" %> Everything works except "/>
<li class="li_spacing"><%= button_to "Website", @restaurant.website, :target => '_blank', :class => "btn btn-primary" %></li>
Everything works except for :target => '_blank'. Why does this not render the the link in a new page?
On
A common way to open a link in a new window was to add a target="_blank" to the link tag.
But for security reasons this should not be done anymore. It is recommended to use rel=noreferrer instead:
link_to 'title', url, rel: 'noreferrer'
Or as a button:
button_to 'title', url, form: { rel: 'noreferrer' }
Change from
button_toto alink_to:button_tois generated inside a form, if you still wish to use it: