routing - How does Ember.js nest routes? -
sorry i'm new ember.js. want create ember.js based app admin section. app should handle admin section urls http://mydomain.com/admin/ ( eg: /admin/photos/, /admin/users) others should work normal url's. can ember.js?
you should use ember resources nest routes. example want this:
appname.router.map(function() { this.resource('admin', function() { this.route('photos'); this.route('users'); }); }); the above create /admin/photos , /admin/users route. mokane linked the right spot in ember docs, future-proofing, i'd put answer in post else can see answer if docs location ever changes.
note: i'd include important point made ugis ozols in comments below in ember, resources nouns while routes typically verbs. have resource /tweet (which noun) , several routes resource create, edit , delete.
Comments
Post a Comment