mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.95k stars 1.18k forks source link

How to get a list of all tags, but only for one context? #1085

Closed h0jeZvgoxFepBQ2C closed 1 year ago

h0jeZvgoxFepBQ2C commented 2 years ago

As the title says, we have multiple models with mutliple contexts..

How can I get a list of all unique tag names, but only for one context? In the readme there is no example and I couldn't find a solution?

veritas1 commented 2 years ago

There is a for_context method on the Tag class, e.g ActsAsTaggableOn::Tag.for_context(:tags) or ActsAsTaggableOn::Tag.for_context(:skills) etc

h0jeZvgoxFepBQ2C commented 2 years ago

Thank you so much, I added a PR to update the Readme with this