title: Remove multiple items from history through JS
body: <p>I have the following flow:</p>
  
  <p>HOME => DEVICES => ADD NEW => SELECT TYPE => PAIR</p>
  
  <p>Users can of course go back at any time.  Now after pairing is complete I go to the DEVICES index page again.<br>
  When a user presses the back button on that page, it returns to PAIR (which I don't want), I want it to go to HOME.  </p>
  
  <p>I've looked at ReplaceState on the final step which changes the PAIR page by the HOME page before redirecting to DEVICES.  That way when the user presses back in the DEVICES page he/she comes back at the home page (great!), however when the user then presses BACK again he arrives at SELECT TYPE which I don't want.</p>
  
  <p>How can I accomplish that when the PAIR is done, the ADD NEW, SELECT TYPE and PAIR page are removed from history?</p>
  
  <p><em>Side note: I'm using Turbolinks and Rails, although I believe the answer would be JS.</em></p>