---
url: /reference/concerns/taggable.md
---
# Trek::Taggable

Tag associations for any model, via the [taxonomy models](/reference/models/tag) (installed by the [taxonomies generator](/reference/generators/taxonomies)).

## What it adds

* `has_many :taggings, as: :taggable, dependent: :destroy`
* `has_many :tags, through: :taggings`
* `tag_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"]
```
