defmodule Medica.Medico do
use Medica.Web, :model
schema "medico" do
field :nombre, :string
field :apellido, :string
field :especialidad, :string
end
@doc """
Builds a changeset based on the `struct` and `params`.
"""
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [:nombre,:apellido,:especialidad])
|> validate_required([:nombre,:apellido,:especialidad])
end
end
This one right?


















