Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nested layouts in Phoenix
defmodule Asciinema.DocController do
use Asciinema.Web, :controller
def show(conn, _params) do
conn
|> put_layout(:docs)
|> render("show.html")
end
end
<div class="container">
<div class="row">
<div class="col-md-3">
...
</div>
<div class="col-md-9">
<%= render @view_module, @tpl %>
</div>
</div>
</div>
<%= render @view_module, "wrapper.html", Map.merge(assigns, %{layout: {Asciinema.LayoutView, "app.html"}, tpl: @view_template}) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment