# Ember from the console

**URL:** <https://discuss.emberjs.com/t/ember-from-the-console/2399>\
**Category:** Ember Data\
**Created:** [September 3, 2013, 2:16pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399 "2013-09-03T14:16:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aftakitani](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/aftakitani/32/4710_2.png) [@aftakitani](https://discuss.emberjs.com/u/aftakitani)\
**Post date:** [September 3, 2013, 2:16pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/1 "2013-09-03T14:16:48Z")

</div>

The ember guides points do this code:

```
var post = App.Post.find(1);

```

[http://emberjs.com/guides/models/finding-models/](http://emberjs.com/guides/models/finding-models/)

Which worked before ember data 1.0b

How do I make this now?

Tks!

---

<div class="post-metadata">

**Author:** ![knownasilya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/knownasilya/32/12912_2.png) [@knownasilya](https://discuss.emberjs.com/u/knownasilya)\
**Post date:** [September 3, 2013, 2:23pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/2 "2013-09-03T14:23:33Z")

</div>

See the post about [migrating to ED 1.0 beta](http://discuss.emberjs.com/t/migrating-from-ember-data-0-13-to-1-0-0-beta-1-my-findings/2368). The new syntax is like so (in the model hook):

```
this.store.find('author', params.author_id);

```

---

<div class="post-metadata">

**Author:** ![aftakitani](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/aftakitani/32/4710_2.png) [@aftakitani](https://discuss.emberjs.com/u/aftakitani)\
**Post date:** [September 3, 2013, 2:27pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/3 "2013-09-03T14:27:11Z")

</div>

No, this doesn’t work from the chrome console.

With previous versions, App.Post.find(1) worked, now it gives me an error.

---

<div class="post-metadata">

**Author:** ![knownasilya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/knownasilya/32/12912_2.png) [@knownasilya](https://discuss.emberjs.com/u/knownasilya)\
**Post date:** [September 3, 2013, 2:42pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/4 "2013-09-03T14:42:24Z")

</div>

Maybe you can do something like:

```
window.store = App. __container__.lookup('store:main');
window.store.find('post', id);

```

Just for debugging in the console, but I recommend getting the [Ember Inspector](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi), that helps with debugging the data as well.

---

<div class="post-metadata">

**Author:** ![aftakitani](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/aftakitani/32/4710_2.png) [@aftakitani](https://discuss.emberjs.com/u/aftakitani)\
**Post date:** [September 3, 2013, 2:46pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/5 "2013-09-03T14:46:27Z")

</div>

Yep, it works, thank you.

I’m not sure this is better than the old way, but works.

---

<div class="post-metadata">

**Author:** ![stefan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/stefan/32/14174_2.png) [@stefan](https://discuss.emberjs.com/u/stefan)\
**Post date:** [September 3, 2013, 7:13pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/6 "2013-09-03T19:13:50Z")

</div>

its better from a “don’t leak globals” sense, likely a loss in ergonomics. I suspect we will see some improvements here shortly.

---

<div class="post-metadata">

**Author:** ![matthewrudy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/matthewrudy/32/14904_2.png) [@matthewrudy](https://discuss.emberjs.com/u/matthewrudy)\
**Post date:** [September 3, 2013, 9:33pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/7 "2013-09-03T21:33:57Z")

</div>

> [@knownasilya](#):
>
> window.store = App. **container**.lookup(‘store:main’)

Perhaps we could put this sort of thing into a special `App.injectDebugHelpers` method just like the `App.injectTestHelpers()` method.

I could imagine something like;

```auto
> App.injectDebugHelpers()
> debug.store
> debug.routes

```

---

<div class="post-metadata">

**Author:** ![slindberg](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/slindberg/32/15091_2.png) [@slindberg](https://discuss.emberjs.com/u/slindberg)\
**Post date:** [November 15, 2013, 9:11pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/8 "2013-11-15T21:11:43Z")

</div>

I too have run into difficulties accessing instances of important application objects in the debug console, so I created a short set of helpers that makes it easy:

[https://gist.github.com/slindberg/7490896](https://gist.github.com/slindberg/7490896)

---

<div class="post-metadata">

**Author:** ![commadelimited](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/commadelimited/32/3548_2.png) [@commadelimited](https://discuss.emberjs.com/u/commadelimited)\
**Post date:** [March 16, 2014, 8:22pm UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/9 "2014-03-16T20:22:42Z")

</div>

@slindberg would you care to share those helpers? 😃

---

<div class="post-metadata">

**Author:** ![slindberg](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/slindberg/32/15091_2.png) [@slindberg](https://discuss.emberjs.com/u/slindberg)\
**Post date:** [March 18, 2014, 12:59am UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/10 "2014-03-18T00:59:59Z")

</div>

@commadelimited apparently gist embedding isn’t working anymore. Hopefully this will work: [http://git.io/dJGyvw](http://git.io/dJGyvw)

---

<div class="post-metadata">

**Author:** ![commadelimited](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/commadelimited/32/3548_2.png) [@commadelimited](https://discuss.emberjs.com/u/commadelimited)\
**Post date:** [March 18, 2014, 5:11am UTC](https://discuss.emberjs.com/t/ember-from-the-console/2399/11 "2014-03-18T05:11:35Z")

</div>

That’s fantastic! Thanks for sharing. Useful indeed!
