Expand answers suggesting to use `target =" _ blank "in Rails ...
If you use the button_to , this is automatically button_to in the Rails form. This is the form tag that needs this attribute. To get it, pass it as a value in the html hash settings, for example:
button_to t(:translated_text), foo_path(foo.id), class: 'btn btn-primary', form: {target: '_blank'}
class: and form: are elements of the html_options hash. The form: parameter is special because it tells Rails that you want to pass the HTML parameter to the form tag, instead of the input tag of the button itself.
Tom harrison jr
source share