mobilizon.chapril.org-mobil.../lib/eventos_web/views/tag_view.ex
Thomas Citharel 20cd1bb579 Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-01-13 23:33:03 +01:00

18 lines
380 B
Elixir

defmodule EventosWeb.TagView do
use EventosWeb, :view
alias EventosWeb.TagView
def render("index.json", %{tags: tags}) do
%{data: render_many(tags, TagView, "tag.json")}
end
def render("show.json", %{tag: tag}) do
%{data: render_one(tag, TagView, "tag.json")}
end
def render("tag.json", %{tag: tag}) do
%{id: tag.id,
title: tag.title}
end
end