Scenario is the following:
- We have a list of (Ember-Data) models displayed in a paged list. Paging is implemented using queryParams
- Each list row displays a “delete” button
- Clicking the “delete” button triggers an action in the controller that calls destroyRecord() on the model
At this point, we want to refresh() the route, since the model is outdated (a new item from the next page should pop up at the end of the list), but Ember cannot detect that on its own (or can it?).
We have identified two ways for doing that:
- send() a “refresh” action from the controller to the route when the destroyRecord() promise is fulfilled
- use the ember-route-action addon and implement the action directly in the route
Obviously the second one would not be idiomatic, since it requires the use of an addon.
Is there any other (better) way to do it?