# Router "this.resource" gone from documentation (v1.11.0)

**URL:** <https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833>\
**Category:** Uncategorized\
**Created:** [April 20, 2015, 10:10pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833 "2015-04-20T22:10:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicvicvic](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/vicvicvic/32/9408_2.png) [@vicvicvic](https://discuss.emberjs.com/u/vicvicvic)\
**Post date:** [April 20, 2015, 10:10pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/1 "2015-04-20T22:10:03Z")

</div>

The “[Defining your routes](http://guides.emberjs.com/v1.11.0/routing/defining-your-routes/)” section in the v1.11.0 guide on [emberjs.com](http://emberjs.com) has removed the documentation for `this.resource`. Is there a reason for this? I can’t find anything about it being deprecated. Issue #10708 seems to hint at this and the change happened 22 days ago but there no real comment about why.

On an unrelated note: I can’t use any hotkeys or copy/paste on this forum; otherwise I would have added links.

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [April 20, 2015, 10:24pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/2 "2015-04-20T22:24:12Z")

</div>

`this.resource` has not been deprecated just yet, but it is planned to be deprecated before 1.13. We removed it from the guides for 1.11, because we do not advise folks to make new apps/routes/etc as resources (it seems bad to suggest folks use a thing we intend to remove when the recommended alternative is ready to use today).

---

<div class="post-metadata">

**Author:** ![vicvicvic](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/vicvicvic/32/9408_2.png) [@vicvicvic](https://discuss.emberjs.com/u/vicvicvic)\
**Post date:** [April 20, 2015, 10:44pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/3 "2015-04-20T22:44:09Z")

</div>

I see now that you can achieve the same thing with just nested routes; hadn’t read the docs closely. The old resource/route stuff divide always confused me so good on unifying it. Good show, thanks! Oh, and now my hotkeys are working again. Strange night.

---

<div class="post-metadata">

**Author:** ![od1n](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/od1n/32/10680_2.png) [@od1n](https://discuss.emberjs.com/u/od1n)\
**Post date:** [April 20, 2015, 11:09pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/4 "2015-04-20T23:09:48Z")

</div>

By the way, when you run `ember g resource any`, it still creates a declaration in the router as for a resource:

```
this.resource('any', function() {});

```

I believe in view of the forthcoming deprecation it should be fixed.

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [April 20, 2015, 11:21pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/5 "2015-04-20T23:21:48Z")

</div>

Seems like a good thing to remove from ember-cli, mind making an issue?

---

<div class="post-metadata">

**Author:** ![od1n](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/od1n/32/10680_2.png) [@od1n](https://discuss.emberjs.com/u/od1n)\
**Post date:** [April 20, 2015, 11:27pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/6 "2015-04-20T23:27:37Z")

</div>

Sure thing, will be there in 10 mins

---

<div class="post-metadata">

**Author:** ![jonathanKingston](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jonathankingston/32/10780_2.png) [@jonathanKingston](https://discuss.emberjs.com/u/jonathanKingston)\
**Post date:** [April 28, 2015, 6:28pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/7 "2015-04-28T18:28:32Z")

</div>

Sounds a lot like a deprecation; perhaps a soft one, I wasn’t aware of the change at all.

Are we able to mark such plans onto a roadmap / rough notes?

---

<div class="post-metadata">

**Author:** ![njs](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@njs](https://discuss.emberjs.com/u/njs)\
**Post date:** [April 29, 2015, 10:11am UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/8 "2015-04-29T10:11:53Z")

</div>

I ran into this the other day - I remembered vaguely seeing some talk of resource going away but it was still odd to see it missing from the docs when ember-cli was happily generating a resource route.

It’s good that that’s being changed but one idea might be to do what the Django docs do and include little panels with headers like ‘Changed in 1.10’, ‘New in 1.11’ or even just ‘Note, this document used to refer to…’

---

<div class="post-metadata">

**Author:** ![enull](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/enull/32/10729_2.png) [@enull](https://discuss.emberjs.com/u/enull)\
**Post date:** [April 30, 2015, 7:20pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/9 "2015-04-30T19:20:17Z")

</div>

> [@rwjblue](#):
>
> we do not advise folks to make new apps/routes/etc as resources

Very very new ember/ember-cli user here.

Does this mean I should or should not use ember g resource for a REST-ish set of routes?

---

<div class="post-metadata">

**Author:** ![grabbou](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/grabbou/32/10835_2.png) [@grabbou](https://discuss.emberjs.com/u/grabbou)\
**Post date:** [May 9, 2015, 11:49am UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/10 "2015-05-09T11:49:57Z")

</div>

Quite said to see it go.

I used to use `this.resource` to define `dashboard` resource that has `AuthenticatedOnlyMixin` and protects all its childs against unauthenticated access. Currently, after converting to `route`, not only all my routes are now prefixed with `dashboard....` but also I have one extra level of directories in both controllers and routes folder…

I’ve also used it to define `dashboard` specific layout (think of it as a `application` but only for authenticated users) that I was unable to put into `application` template due to login/register pages having a different theme.

Any better workaround?

Defining Authenticated only mixing on every single top-level route inside a dashboard route just feels wrong to me.

---

<div class="post-metadata">

**Author:** ![mixonic](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mixonic/32/14829_2.png) [@mixonic](https://discuss.emberjs.com/u/mixonic)\
**Post date:** [May 10, 2015, 2:42am UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/11 "2015-05-10T02:42:42Z")

</div>

@grabbou You can reset the namespace on route with an option:

```
this.route('dashboard', {}, function() {
  this.route('top-level-route', {resetNamespace: true});
});

```

Basically, passing `resetNamespace: true` is the same as calling `resource`.

Here is a complex router file [for an example](https://github.com/aptible/dashboard.aptible.com/blob/master/app/router.js#L13).

---

<div class="post-metadata">

**Author:** ![grabbou](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/grabbou/32/10835_2.png) [@grabbou](https://discuss.emberjs.com/u/grabbou)\
**Post date:** [May 10, 2015, 7:17am UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/12 "2015-05-10T07:17:34Z")

</div>

Thanks, works like a charm 🙂

---

<div class="post-metadata">

**Author:** ![apelsinikaru](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/apelsinikaru/32/15062_2.png) [@apelsinikaru](https://discuss.emberjs.com/u/apelsinikaru)\
**Post date:** [June 30, 2015, 6:03pm UTC](https://discuss.emberjs.com/t/router-this-resource-gone-from-documentation-v1-11-0/7833/13 "2015-06-30T18:03:07Z")

</div>

Recource is still gone from Ember docs and guides and at the same time there is no documentation about resetNamespace flag. This can cause a lot of problems for newcomers.
