Skip to content

Instantly share code, notes, and snippets.

@shankardevy

shankardevy/category_controller.ex Secret

Last active Aug 18, 2017
Embed
What would you like to do?
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