I have the url /tests/test-slug?extradata=data all my params are setup correctly within ember. When that extradata param is set the model updates with the new data from the (/tests/test-slug?extradata=data) response. Usually I would retrieve data using ember-model by doing:
model: function (params) {
return App.Test.findQuery(params);
}
But with the query parameter added to this nested url its giving me 'test-slug' as a param with the extradata and making a request to the server with: ?tests_slug=test-slug&extradata=data
Is there anyway I can use query params and update my model on a nested route?
Edit: this post explains it a lot better than me: Ember data - dynamic segments and query params together?
Extend your route's params with the parant route's params and send that into .findQuery()
Ember.$.extend(params, this.paramsFor('parentRoute'));
More: http://emberjs.com/api/classes/Ember.Route.html#method_paramsFor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With