Skip to content

Instantly share code, notes, and snippets.

@Mariusio
Created January 26, 2016 18:44
Show Gist options
  • Save Mariusio/3373f85a37e372c98b2f to your computer and use it in GitHub Desktop.
Save Mariusio/3373f85a37e372c98b2f to your computer and use it in GitHub Desktop.
// Option A
Router.map(function() {
this.route('dashboards', function() {
this.route('new');
this.route('edit', {
path: ':dashboard_id/edit'
});
this.route('show', {
path: ':dashboard_id'
}, function(){
this.route('charts', function(){
this.route('new');
this.route('edit', {
path: ':chart_id/edit'
});
this.route('show', {
path: ':chart_id'
})
});
});
});
});
export default Router;
// Option B
Router.map(function() {
this.resource('dashboards', function() {
this.route('new');
this.route('edit', {
path: ':dashboard_id/edit'
});
this.route('show', {
path: ':dashboard_id'
}, function(){
this.resource('charts', function(){
this.route('new');
this.route('edit', {
path: ':chart_id/edit'
});
this.route('show', {
path: ':chart_id'
})
});
});
});
});
export default Router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment