Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Last active August 18, 2017 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankardevy/e720387f72a77cfceba581bc7624a724 to your computer and use it in GitHub Desktop.
Save shankardevy/e720387f72a77cfceba581bc7624a724 to your computer and use it in GitHub Desktop.
defmodule MangoWeb.CategoryController do
use MangoWeb, :controller
alias Mango.Catalog
def show(conn, %{"name" => name}) do
products = Catalog.get_category_products(name)
conn
|> assign(:products, products)
|> assign(:name, name)
|> render("show.html")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment