# I need to extend serializers/application.js in others serializers?

**URL:** <https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614>\
**Category:** Uncategorized\
**Created:** [March 17, 2017, 12:19pm UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614 "2017-03-17T12:19:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginolon](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@ginolon](https://discuss.emberjs.com/u/ginolon)\
**Post date:** [March 17, 2017, 12:19pm UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614/1 "2017-03-17T12:19:26Z")

</div>

Let’s say I have this **serializers/application.js** :

```
import Ember from 'ember';
import DS from 'ember-data';

export default DS.JSONAPISerializer.extend({

  keyForAttribute: function (attr) {
    return Ember.String.underscore(attr);
  },

});

```

Now I need another serializer for one of my model: **serializers/post.js** :

```
import DS from 'ember-data';

export default DS.JSONAPISerializer.extend({

  attrs: {
    my_game: {
      serialize: false
    }
  }

});

```

My **serializer/post** now doesn’t take _automagically_ the code from **serializers/application.js** , so this code doesn’t work anymore in my **post** model:

```
keyForAttribute: function (attr) {
  return Ember.String.underscore(attr);
}

```

I need to **extend** the **serializers/application.js** in my _serializers/post.js_?

---

<div class="post-metadata">

**Author:** ![alexspeller](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/alexspeller/32/14812_2.png) [@alexspeller](https://discuss.emberjs.com/u/alexspeller)\
**Post date:** [March 18, 2017, 11:23am UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614/2 "2017-03-18T11:23:41Z")

</div>

Yes, that’s right. You need to extend it

---

<div class="post-metadata">

**Author:** ![ginolon](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@ginolon](https://discuss.emberjs.com/u/ginolon)\
**Post date:** [March 18, 2017, 11:38am UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614/3 "2017-03-18T11:38:48Z")

</div>

Can you show me how please?

---

<div class="post-metadata">

**Author:** ![matheos](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matheos](https://discuss.emberjs.com/u/matheos)\
**Post date:** [March 20, 2017, 3:34am UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614/4 "2017-03-20T03:34:29Z")

</div>

**serializers/post**

```
import AppSerializer from '{your-ember-app}/serializers/appliecation';

export default AppSerializer.extend({

});

```

---

<div class="post-metadata">

**Author:** ![ginolon](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@ginolon](https://discuss.emberjs.com/u/ginolon)\
**Post date:** [March 20, 2017, 5:27pm UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614/5 "2017-03-20T17:27:00Z")

</div>

And if I already have this:

```
import DS from 'ember-data';
export default DS.JSONAPISerializer.extend({

........

});

```

???

---

<div class="post-metadata">

**Author:** ![matheos](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matheos](https://discuss.emberjs.com/u/matheos)\
**Post date:** [March 21, 2017, 6:07am UTC](https://discuss.emberjs.com/t/i-need-to-extend-serializers-application-js-in-others-serializers/12614/6 "2017-03-21T06:07:28Z")

</div>

To extend your application serializer on your post serializer you will need to replace the 1st two lines with the ones I mentioned previously.
