analytics/lib/plausible_web/views/error_helpers.ex

10 lines
258 B
Elixir
Raw Normal View History

2019-09-02 14:29:19 +03:00
defmodule PlausibleWeb.ErrorHelpers do
use Phoenix.HTML
def error_tag(form, field) do
Enum.map(Keyword.get_values(form.errors, field), fn error ->
content_tag(:div, elem(error, 0), class: "text-red-500 text-xs italic mt-3")
2019-09-02 14:29:19 +03:00
end)
end
end