Current section
10 Versions
Jump to
Current section
10 Versions
Compare versions
5
files changed
+11
additions
-3
deletions
| @@ -45,7 +45,7 @@ defmodule MyAppWeb.Admin.ProductsView do | |
| 45 45 | use MyAppWeb, :view |
| 46 46 | |
| 47 47 | def render("index.json", %{records: products}) do |
| 48 | - %{products: Enum.map(&render("show.json", response: &1))} |
| 48 | + %{products: Enum.map(&render("show.json", %{record: &1}))} |
| 49 49 | end |
| 50 50 | |
| 51 51 | def render("show.json", %{record: product}) do |
| @@ -31,4 +31,4 @@ | |
| 31 31 | {<<"optional">>,false}, |
| 32 32 | {<<"repository">>,<<"hexpm">>}, |
| 33 33 | {<<"requirement">>,<<"~> 1.2">>}]]}. |
| 34 | - {<<"version">>,<<"0.1.4">>}. |
| 34 | + {<<"version">>,<<"0.1.5">>}. |
| @@ -43,6 +43,10 @@ defmodule Transponder.HTML do | |
| 43 43 | |> redirect(to: "/") |
| 44 44 | end |
| 45 45 | |
| 46 | + def format(:index, conn, {:ok, records}) do |
| 47 | + format(:index, conn, records) |
| 48 | + end |
| 49 | + |
| 46 50 | def format(:index, conn, records) do |
| 47 51 | render(conn, "index.html", records: records) |
| 48 52 | end |
| @@ -20,6 +20,10 @@ defmodule Transponder.JSON do | |
| 20 20 | |> render("error.json", changeset: changeset) |
| 21 21 | end |
| 22 22 | |
| 23 | + def format(:index, conn, {:ok, records}) do |
| 24 | + format(:index, conn, records) |
| 25 | + end |
| 26 | + |
| 23 27 | def format(:index, conn, records) do |
| 24 28 | render(conn, "index.json", records: records) |
| 25 29 | end |
| @@ -4,7 +4,7 @@ defmodule Transponder.MixProject do | |
| 4 4 | def project do |
| 5 5 | [ |
| 6 6 | app: :transponder, |
| 7 | - version: "0.1.4", |
| 7 | + version: "0.1.5", |
| 8 8 | elixir: "~> 1.9", |
| 9 9 | start_permanent: Mix.env() == :prod, |
| 10 10 | description: "DSL for declarative Phoenix controllers", |