title: How to render rails partial into a new browser tab
body: <p>How can I render a rails _partial.html.erb into a new browser tab?</p>
  
  <p>Let me explain:</p>
  
  <p>I have a Ruby on Rails MVC CRUD with a simple form within new.html.erb, which user fill almost 25 fields and submit a form.</p>
  
  <p>Inside the controller there's a <strong>create</strong> method, defined to create everything into database and then invoke a method to send this document to the printer..</p>
  
  <p>In order to do that, inside the <strong>create</strong> method it's rendering a html template view which content is a lot of variables being printed with a pretty html+css template... and then on document ready it calls window.print() via javascript.</p>
  
  <p>It's working fine but I would like to change this behaviour. I want that when new.html.erb submits the form, active tab gets redirected back to documents index (<em>it's ok for me up to here</em>) and the document, which will be printed, open rendering in a new tab, focused. </p>
  
  <p>Current solution is:</p>
  
  <pre><code>def create
    ... # lots of commands here
    render partial: 'contracts/printer/contract_template'
  end
  </code></pre>
  
  <p>How can I code this last doubt: ..."<em>the document, which will be printed, open rendering in a new tab, focused.</em>" ?</p>