mobilizon/lib/mobilizon_web/views/track_view.ex
Thomas Citharel 559c889f1b Rename project to Mobilizon
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-10-11 17:37:39 +02:00

20 lines
505 B
Elixir

defmodule MobilizonWeb.TrackView do
@moduledoc """
View for Tracks
"""
use MobilizonWeb, :view
alias MobilizonWeb.TrackView
def render("index.json", %{tracks: tracks}) do
%{data: render_many(tracks, TrackView, "track.json")}
end
def render("show.json", %{track: track}) do
%{data: render_one(track, TrackView, "track.json")}
end
def render("track.json", %{track: track}) do
%{id: track.id, name: track.name, description: track.description, color: track.color}
end
end