Packages

Taglet allows you to manage tags associated to your records. It also allows you to specify various contexts

Current section

Files

Jump to
taglet lib taglet tag.ex
Raw

lib/taglet/tag.ex

defmodule Taglet.Tag do
use Ecto.Schema
import Ecto.Changeset
schema "tags" do
field :name, :string, null: false
has_many :taggings, Taglet.Tagging
end
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [:name])
|> validate_required(:name)
end
end