I'm trying to make a search inside a nested route particularly that shares model.
Here's my code example
Products and Search returns a json
Router
Market.Router.map ->
@resource 'products'
@resource 'search', { path: "products/search" }
@resource 'product', { path: "products/:product_id" }
The rest adapter api url I'm trying to achieve is the following:
http://api.url:3000/v1/products/search?search_terms="rope"
I have an action inside a header menu controller for the search
How do I find records inside a nested route?
Market.HeaderMenuController = Ember.ArrayController.extend({
searchText: null,
actions: {
searchResults: function(){
this.store.find('product', 'search?search_terms='+this.searchText);
this.store.find('search', { "search_terms":this.searchText });
}
}
});
I get the following errors -
Error: Assertion Failed: You must include an
id
for Market.Product in an object passed topush
Uncaught Error: Assertion Failed: Error: Assertion Failed: You must include an
id
for Market.Product in an object passed topush