Skip to content

Remove PhoenixView in favor of documenting how to integrate. #164

@alanpeabody

Description

@alanpeabody

This is in the spirit of explicit over implicit.

Suggested by @nurugger07 in #34.

All view really needs is:

defmodule Example.PostView do
  use Example.Web, :view
  use JaSerializer

  def render(action, %{data: data, conn: conn} = args) when action in ["index.json-api", "show.json-api"] do
    JaSerializer.format(__MODULE__, data, conn, args[:opts] || [])
  end

  attributes [:title, :body]
end

Something would also need to be added to the changeset and error views.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions