I have a Filter model, and the user can change this model by clicking on the page.
So, when the user makes changes to the model, I want to go to the same route that he is currently in, because the URL differs depending on the details of the model (I redefined "serialization" on the way to make sure that it is).
As things are now, Amber seems to be ignoring my requests to switch to the same route with the same model. The model has changed and my template will change, but I want the URL to also reflect the filter change.
How can i do this?
Edit:
Here is the code in my ApplicationController
App.ApplicationController = Ember.Controller.extend currentFilter: null actions: toggleRegion: (region_id) -> region = this.store.getById('region', region_id) filter = this.get('currentFilter') # modify the filter if filter.containsAtLeastOneCityOfRegion(region) filter.disableRegion(region) else filter.enableRegion(region) this.replaceRoute('listings', filter)
Now it works as intended when I am on the βindexβ route, but if I am already on the βlistsβ route, the model changes as intended, but the route does not change, and therefore my URL is not updated using the correct dynamic segments (based on the "serialize" method associated with the listing schedule).
source share