I am using ember-rest in my application for persistence layer, and it has been working great. One of the resources that I am working with, requires some optional resource parameters. Looking at the ember-rest source code, I couldn’t find anything related to setting request parameters, but it is possible that I overlooked something.
My question is, does ember-rest provide a way to specify request parameters to be appended to the URL? If not, some advice about how I should add this functionality to ember-rest would be very appreciated.
For example, I am working with a resource called blocki which comes with the following REST api:
POST /api/apps/:app_id/blockies?parent=:parent_id
- default :parent_id=:app_id
- TODO: error if the blocki cannot be placed in :parent_id
PUT /api/blockies/:id
PUT /api/blockies/:id?parent=:parent_id
- update the blocki and reparent it
DELETE /api/blockies/:id
As you can see when I do a put request to update this resource I can optionally pass a parent_id if I want to update that. I want to achieve this using ember-rest.
You can completely customize the url for a resource or resource controller by overriding the
_resourceUrl()method. For instance: