title: Rails redirect without history
body: <p>We have a page in our Rails application whereby when the user submits a form we want to redirect them somewhere else and if they were to click the back button in the browser, it would NOT take them back to that previous page.</p>
  
  <p>Using <code>redirect_to our_new_path</code> therefore doesn't work in this case.</p>
  
  <p>Our solution was to use JavaScript to handle it. So we submit the form using AJAX and then Rails responds like so:</p>
  
  <p><code>render json: { redirect: our_new_path }</code></p>
  
  <p>and then we do a replace with the response so it doesn't create the history:</p>
  
  <p><code>(data) =&gt; window.location.replace(data.redirect)</code></p>
  
  <p>However we don't really like the reliance on JavaScript for this... is it possible to do a redirect with HTTP redirects in Rails that don't create a history?</p>