Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Last active August 22, 2017 16:02

Revisions

  1. shankardevy revised this gist Aug 22, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions category_controller.ex
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    defmodule Mango.Web.CategoryController do
    use Mango.Web, :controller
    defmodule MangoWeb.CategoryController do
    use MangoWeb, :controller
    alias Mango.Catalog

    def show(conn, _params) do
  2. shankardevy created this gist Jul 14, 2017.
    13 changes: 13 additions & 0 deletions category_controller.ex
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    defmodule Mango.Web.CategoryController do
    use Mango.Web, :controller
    alias Mango.Catalog

    def show(conn, _params) do
    products = Catalog.list_products
    conn
    |> assign(:products, products)
    |> assign(:name, "Title")
    |> render("show.html")
    end

    end