I’ve ran into an issue with link-to helper and a route which has optional query params.
I have a ‘projects’ route which lists all Projects, but the related view also offers a list of links which filter the Projects out by their Category ('/projects?category=art'). So, default controller properties that link to query-params are all null. I’m having a hard time figuring out how to place a link-to helper in the same view which leads to a ‘clean’ route, without the query params. Placing a link-to helper with no query-params just leads to the current projects route, keeping any query params from the current URL - and what’s worse, keeps it marked as active.
Is there any way to force the link-to helper to ignore current URL query params?
I’ve ran into a similar issue, I have a controller that supports quite a handful of query params and would like to have a link-to that reset all of the query parameters to their defaults.
Currently there doesn’t seem to be any way to do this without explicitly specifying each and every query param that you want to reset, and having a reference to what the default should be.