How can one structure nested routes when parent objects are not persisted (have no :id)?
I'm basically building a object configuration wizard, where a book has several child configuration models. the user's path through the configuration is roughly:
- Users upload manuscripts, and the record is persisted.
- User transitions to book/configuration/cover
- User can go back and forth between various configuration subroutes.
- After configuring, user clicks to trigger persisting the parent and children.
- After the book is persisted, they could go back to edit.
Must I create two sets of routes - one for edit and one for new that omits the book.id in the path? Is there a way to do it in one go?
//my routes:
this.route('upload-manuscripts', function() {
this.route('new');
});
Router.map(function() {
this.route('book', {path: '/:id'}, function() {
this.route('configuration', function() {
this.route('cover');
this.route('spine');
this.route('pagination');
});
});
});
Thanks!
Aucun commentaire:
Enregistrer un commentaire