# Model weirdness

**URL:** <https://discuss.emberjs.com/t/model-weirdness/6754>\
**Category:** Ember Data\
**Created:** [November 20, 2014, 5:14pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754 "2014-11-20T17:14:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [November 20, 2014, 5:14pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/1 "2014-11-20T17:14:58Z")

</div>

If I define in my route a model:

```
App.PhotoRoute = Ember.Route.extend({
  model: function(params) {
    return this.store.find('photo', params.photo_id);
  }
});

```

and this code goes off to the server to fetch that photo because I am using a RESTAdapter…

Should I expect that photo to be pushed into the store? As in - when I go into the ember tab in chrome and navigate to Data - should I expect to see it there?

Basically - as you can probably guess - I cannot. I am stumped however as it used to work like this I am pretty sure.

What would cause this to happen?

if you would like an example see here:

[http://test.sonatribe.co.uk:8080/event/glastonbury-2013](http://test.sonatribe.co.uk:8080/event/glastonbury-2013)

There is data being loaded from my route but in the ember console there is no data!

Is this because I am using the latest ember-data perhaps?

```
DEBUG: ------------------------------- 
DEBUG: Ember : 1.8.0 
DEBUG: Ember Data : 1.0.0-beta.11 
DEBUG: Handlebars : 1.3.0 
DEBUG: jQuery : 1.11.1
DEBUG: -------------------------------

```

---

<div class="post-metadata">

**Author:** ![MrMcDowall](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mrmcdowall/32/14414_2.png) [@MrMcDowall](https://discuss.emberjs.com/u/MrMcDowall)\
**Post date:** [November 20, 2014, 6:55pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/2 "2014-11-20T18:55:33Z")

</div>

Yes, you should see a record in the Ember Inspector after that code executes. It sounds like maybe the format of the JSON coming from your back end might not be what Ember Data is expecting. Compare what your server is sending back with what you can generate here: [EmberDataModelMaker](http://andycrum.github.io/ember-data-model-maker/) and look for any discrepancies.

---

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [November 20, 2014, 7:20pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/3 "2014-11-20T19:20:55Z")

</div>

But the data loads. You can see it on screen. Surely if the JSON was wrong it wouldn’t even show?

---

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [November 20, 2014, 7:22pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/4 "2014-11-20T19:22:03Z")

</div>

That project does look v interesting though!

---

<div class="post-metadata">

**Author:** ![kgish](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kgish/32/13333_2.png) [@kgish](https://discuss.emberjs.com/u/kgish)\
**Post date:** [November 20, 2014, 8:19pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/5 "2014-11-20T20:19:00Z")

</div>

Can you please show us your `DS.Model` definition of `App.Photo` ?

---

<div class="post-metadata">

**Author:** ![MrMcDowall](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mrmcdowall/32/14414_2.png) [@MrMcDowall](https://discuss.emberjs.com/u/MrMcDowall)\
**Post date:** [November 20, 2014, 9:47pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/6 "2014-11-20T21:47:21Z")

</div>

I guess I’m confused: you’re saying that the data loads, and the record displays on screen, but there’s nothing in the Ember Inspector? Is there anything at all in the Ember Inspector (View Tree, Routes, etc)?

---

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [November 21, 2014, 8:06am UTC](https://discuss.emberjs.com/t/model-weirdness/6754/7 "2014-11-21T08:06:02Z")

</div>

@MrMcDowall - you can see from the demo link: [http://test.sonatribe.co.uk:8080/event/glastonbury-2013](http://test.sonatribe.co.uk:8080/event/glastonbury-2013) - the data loads, the routes are all there - just no data…

---

<div class="post-metadata">

**Author:** ![turboMaCk](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/turbomack/32/15711_2.png) [@turboMaCk](https://discuss.emberjs.com/u/turboMaCk)\
**Post date:** [November 21, 2014, 2:15pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/8 "2014-11-21T14:15:30Z")

</div>

At first try to fix this:

```
Uncaught Error: Assertion Failed: You cannot use the same root element (body) multiple times in an Ember.Application

```

---

<div class="post-metadata">

**Author:** ![Wayne\_Douglas](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wayne_douglas/32/9568_2.png) [@Wayne\_Douglas](https://discuss.emberjs.com/u/Wayne_Douglas)\
**Post date:** [November 21, 2014, 4:30pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/9 "2014-11-21T16:30:46Z")

</div>

Yeah - I have no idea what the hell is causing that - has anyone seen that before?

I am definitely not creating more than one application:

> <https://stackoverflow.com/questions/11571896/you-cannot-use-the-same-root-element-body-multiple-times-in-an-ember-applicati>

So it’s not that

It is failing in `Setup()`

At this line:

```
Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));

```

So it is saying that before it can run setup it has already been setup… and setting a breakpoint here does indeed break twice… What would be causing that? The run loop makes it hard to see where these calls are coming from

---

<div class="post-metadata">

**Author:** ![turboMaCk](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/turbomack/32/15711_2.png) [@turboMaCk](https://discuss.emberjs.com/u/turboMaCk)\
**Post date:** [November 21, 2014, 7:08pm UTC](https://discuss.emberjs.com/t/model-weirdness/6754/10 "2014-11-21T19:08:31Z")

</div>

I think that problem might be in your HTML file.

try to add something like this after tag

```
<div id="thisisuniqueid"></div>

```

and define root element in Ember.Application.create

```
App = Ember.Application.create({
    rootElement: '#thisisuniqueid', .....

```
