Open mackermedia opened 10 years ago
So you want to be able to ignore the query portion of a URL optionally? Seems pretty legit.
Well not exactly ignore the whole query portion. I believe there's already an option for that. In this case I'd like it match the query portion when it's present regardless of whether or not there are additional query parameters.
Does that make sense?
Yes it does. Matching on partial queries, i.e. if the link is a proper subset or the current URL.
Maybe something like partial_query: true
then?
Good call. Better name indeed.
This sounds great. My only concern is I am interested in limiting complexity that can make it difficult to maintain this gem. So one thing I'd like to see is us reuse Rack or Rails code for parsing the params. Also, how about the option name :match_partial_query
? Other than that let's see some code and go from there.
@mackermedia any update on this? Need help?
Currently the request matching is on either full url or segment.
I have a scenario where my link is: http://example.com/stores?category=electronics and this is working just fine.
However, when we add a second query parameter (eg. http://example.com/stores?category=electronics&order=name-) nav_lynx no longer shows the link as "selected".
I propose adding an option for
param_is_included: true
.This would parse query params and then look to see if the
nav_lynx
helper link's query parameter is included in the parsed collection of query parameters.Thoughts @brianjlandau, @greypants, @Fosome ?