# Serialize ember-data models into query-params

**URL:** <https://discuss.emberjs.com/t/serialize-ember-data-models-into-query-params/4271>\
**Category:** Uncategorized\
**Created:** [February 25, 2014, 10:09pm UTC](https://discuss.emberjs.com/t/serialize-ember-data-models-into-query-params/4271 "2014-02-25T22:09:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![opsb](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/opsb/32/9475_2.png) [@opsb](https://discuss.emberjs.com/u/opsb)\
**Post date:** [February 25, 2014, 11:37pm UTC](https://discuss.emberjs.com/t/serialize-ember-data-models-into-query-params/4271/2 "2014-02-25T23:37:05Z")

</div>

I see a good suggestion at [https://gist.github.com/machty/7923797](https://gist.github.com/machty/7923797) but it doesn’t look like it’s been implemented. In this case it would look like:

```
export
default Ember.Controller.extend({
    queryParams: {
        discipline: {
            serialize: function(discipline){
                return discipline.get("id");
            },
            deserialize: function(disciplineId){
                return this.store.get(disciplineId);
            }
        }
    },
    discipline: null
});

```

---

_[View the full topic](https://discuss.emberjs.com/t/serialize-ember-data-models-into-query-params/4271)._
