title: Backbone.js: Routing for nested views
body: <p>I'm trying to figure out following scenario:</p>
  
  <p>Lets say that I have two views: one for viewing items and one for buying them. The catch is that buying view is a sub view for viewing. </p>
  
  <p>For routing I have:</p>
  
  <pre><code>var MyRouter = Backbone.Router.extend({
    routes: {
      'item/:id': 'viewRoute',
      'item/:id/buy': 'buyRoute'
    }
  });
  
  var router = new MyRouter;
  
  router.on("route:viewRoute", function() {
    // initialize main view
    App.mainview = new ViewItemView();
  
  });
  
  router.on("route:buyRoute", function() {
    // initialize sub view
    App.subview = new BuyItemView();
  });
  </code></pre>
  
  <p>Now if user refreshes the page and <code>buyRoute</code> gets triggered but now there is no main view. What would be best solution to handle this?</p>