TryGhost/Ghost — pull request #2768 by jgable (2014-05-15 02:02:41+00:00)
Title: Add ghostPaths util and initializer

No Issue

- Move the ghostPaths from base model to utils
- Add initializer that injects it into every route, model and controller
- Add a adminUrl and apiUrl helper method

Here is some example usage you might use in a routes model function:

```js
// /ghost/api/v0.1/posts/
var postsUrl = this.get('ghostPaths').apiUrl('posts');

// /ghost/api/v0.1/posts/1/
var postsUrl = this.get('ghostPaths').apiUrl('posts', params.post_id);

// /ghost/signin/
var signInUrl = this.get('ghostPaths').adminUrl('signin');
```

I'm open to suggestion on the injected name being `ghostPaths`, it could possible be just `paths`.