Ghost/ghost/admin/routes/posts/index.js
Taras Mankovski 01b49fede8 Minor refactoring of the routers:
- Moved post route under posts resource
- Changed ajax to use ic.ajax.request instead of ic.ajax.raw
2014-03-07 14:01:27 +00:00

10 lines
279 B
JavaScript

export default Ember.Route.extend({
// redirect to first post subroute
redirect: function () {
var firstPost = (this.modelFor('posts') || []).get('firstObject');
if (firstPost) {
this.transitionTo('posts.post', firstPost);
}
}
});