I am using pods for development and the app is in very initial stage.
I have a links settings page which I have added in app/settings/page/link/
in my router.js it looks likes
Router.map(function() {
this.route('login', {path: '/login'});
this.route('settings', function() {
this.route('page', function() {
this.route('link');
this.route('groups');
});
});
});
I also need to create a model for page links, which I have created in app/settings/page/links
folder. When I fetch the page it give me error that WARNING: Encountered "links" in payload, but no model was found for model name "link" (resolved model name using lp@serializer:-rest:.modelNameFromPayloadKey("links"))
So on my rest client I have changed the out put from
{"links":[
{
"id":1,
"display_name":"Page Links",
"backend_name":"Page Links",
"url":"settings.page.links",
"created_by":null,
"updated_by":null,
"created_at":"0000-00-00 00:00:00",
"updated_at":"0000-00-00 00:00:00"
}
]
}
to
{"settings/page/links":[
{
"id":1,
"display_name":"Page Links",
"backend_name":"Page Links",
"url":"settings.page.links",
"created_by":null,
"updated_by":null,
"created_at":"0000-00-00 00:00:00",
"updated_at":"0000-00-00 00:00:00"
}
]
}
I can see that it loaded the data in Ember Inspector. But I dont like how I have to change the REST client to match my model.
Also when I save the page, Ember is sending whole 'settings/page/links/ in the payload
So on the PHP side I have to get it like below, which is not good
$data = $input->get('settings/page/link');
$display_name = $data['display_name'];
$backend_name = $data['backend_name'];
$url = $data['url'];