Skip to content

Instantly share code, notes, and snippets.

@zookzook
Last active March 10, 2020 07:36
Show Gist options
  • Select an option

  • Save zookzook/3e98ab94ec1f670ca4dd0d2b2f353fd3 to your computer and use it in GitHub Desktop.

Select an option

Save zookzook/3e98ab94ec1f670ca4dd0d2b2f353fd3 to your computer and use it in GitHub Desktop.
PageController
defmodule PolarisWeb.PageController do
use PolarisWeb, :controller
alias Polaris.Page
def index(conn, _params) do
%Page{title: title, content: content} = Polaris.Site.index()
conn
|> assign(:page_title, title)
|> assign(:pars, content["pars"])
|> render("index.html")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment