# Render server response to ember main view

**URL:** <https://meta.discourse.org/t/render-server-response-to-ember-main-view/47861>\
**Category:** Development\
**Created:** [27 Julio, 2016 10:18 UTC](https://meta.discourse.org/t/render-server-response-to-ember-main-view/47861 "2016-07-27T10:18:25Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![EndruK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/endruk/32/50211_2.png) [@EndruK](https://meta.discourse.org/u/EndruK)\
**Post date:** [27 Julio, 2016 10:18 UTC](https://meta.discourse.org/t/render-server-response-to-ember-main-view/47861/1 "2016-07-27T10:18:25Z")

</div>

Hi,  
I retrieve some content from my server and want to render it to the Ember Main View.

Currently I add a div called disraptorView and append via jQuery the Content retrieved from the server controller.  
The Problem is: once there is some content in this div it is always displayed when someone is navigating on the page.

I want to render my response to the Ember Main View but I have no idea how to properly do that.

This is my Ember Controller:

```plaintext
export default Ember.Controller.extend({
  init: function() {
    this.send('loadContent');
  },
  actions: {
    loadContent() {
      var pathArray = window.location.pathname.split('/');
      var subpath = pathArray[pathArray.length-1];
      var type;
      type = (subpath == "") ? "main" : "sub";
      Discourse.ajax({
        url: `/disraptor`,
        type: 'GET',
        dataType: 'text',
        data: {"url":subpath,"type":type}
      })
      .then(function(result) {
        $(".disraptorView").empty();
        $(".disraptorView").append($(result));
      })
      .catch(function(error) {
        console.log(error);
      });
    }

  }
});

```

Here is what it produces:

 ![](https://global.discourse-cdn.com/meta/original/3X/6/3/63119369be52d36c5797f40f080883f506bb76d4.png)

and when I move to another page on the client:

 ![](https://global.discourse-cdn.com/meta/original/3X/b/d/bd447806c1da920389572c64ae7125b91a574319.png)

---

_[View the full topic](https://meta.discourse.org/t/render-server-response-to-ember-main-view/47861)._
