yeoman/generator-ember — pull request #132 by christiangenco (2013-11-18 17:58:58+00:00)
Title: more concise REST routes in router.js to close #131

Currently, REST routes generated by `yo ember:model` produce the following:

App.Router.map(function () {

this.resource('user_edit');
this.resource('user_edit', { path: '/user_edit/:user_edit_id' });
this.resource('user_edit.edit', { path: '/user_edit/:user_edit_id/edit' });

this.resource('users');
this.resource('user', { path: '/user/:user_id' });
this.resource('user.edit', { path: '/user/:user_id/edit' });

});

Whereas [An In-depth Introduction to Ember.js](http://coding.smashingmagazine.com/2013/11/07/an-in-depth-introduction-to-ember-js/#instantiate_the_router) recommends the more concise:

```javascript
App.Router.map(function(){
this.resource('users', function(){
this.resource('user', { path:'/:user_id' }, function(){
this.route('edit');
});
this.route('create');
});
});
```

This commit changes `router.js` to generate routes with the later convention.

The only tricky part of this commit was changing `router/index.js` to get the list of model names from files in `app/scripts/models` instead of `app/scripts/controllers/` to prevent separate routes for `user_edit`.