How do I get a list of articles associated with a particular tag stored in tag_list?
TagList field does add a few methods to your node class to help exactly with this…
Assuming the following:
class Page < PushType::Node field :tags, :tag_list end
TagList field dynamically defines the following methods. The method names are determined by the field name, so if you haven’t called the field “tags” then adjust the following method names accordingly.
# Return all Page nodes which contains all the passed tags Page.with_all_tags('foo', 'bar', 'baz') # Return all Page nodes which contains any of the passed tags Page.with_any_tags('foo', 'bar', 'baz') # Return an array of all tags from all Page nodes Page.all_tags
Can you add this answer to the documentation? That would be really handy