With Ember 2.x in mind how should you structure routes when creation of an object relies on a parent object?


My example is:

We view our /customers/. We select a customer /customers/1234/ We want to create an order for that customer - so perhaps /customers/1234/order/create.

The idea is an order has a customer and, at least to start with, we start the creation process from the customer page.

Most of the examples I see involve a mixture of resourse and routes, firstly how would I setup my router.js and routes using up to date recommendations?

So far I have:

  this.route('customer', {path: "customers/:customer_id"}, function() {
    //something here for order/create?

Secondly, I want /customers/customer_id/order/create to render over the parent customer outlet as the orders are quite complex so I want the whole of my main display area available. How do I achieve this? I’m struggling to get the folder/route structure correct.

And finally - bearing Ember 2.x and routable components coming etc, is there a better way I should be structuring this in any case?