Trek::Taggable
Tag associations for any model, via the taxonomy models (installed by the taxonomies generator).
What it adds
has_many :taggings, as: :taggable, dependent: :destroyhas_many :tags, through: :taggingstag_names— the tag names as an array of strings
Usage
ruby
class Article < ApplicationRecord
include Trek::Taggable
end
article.tags << Tag.find_or_create_by(name: "Ruby", key: "ruby")
article.tag_names # => ["Ruby"]