Paths (as hash) with different controllers but the same action name should not be highlighted? #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The spec I wrote shows my interpretation of the expected behaviour of
Item.highlights_on?
. This is how the method is used when the:highlights_on
option has not been set whenNavigasmic::Item.new
is called with the link specified as a hash.I do not know whether my interpretation is correct but in aefed7c where this behaviour was previously modified, the change in line 38 (hash matching using OR logic instead of AND) of item.rb seems unnecessary for the implementation of the multi-controller feature (because they are in separate hashes).
I discovered this issue while I was using navigasmic to generate links to sign_in and sign_up of the Devise authentication gem. The link sign_in would be highlighted even though I was on the sign_up page.
Related to this, it seems like it would be useful in the future to add an optional parameter to
semantic_navigation
to specify the default behaviour ofItem.highlights_on?
so that for example, a navigation menu in the top bar could highlight on the same controller but a side menu would highlight only when the action also matches.