Crie slugs de campos Ecto automaticamente

Instale https://github.com/sobolevn/ecto_autoslug_field Então: defmodule NameSlug do use EctoAutoslugField.Slug, from: :name, to: :slugenddefmodule User do use Ecto.Schema import Ecto.Changeset schema “users” do field :name, :string field :slug, NameSlug.Type end @required_fields ~w(name) …

Continuar lendo