Skip to content

Instantly share code, notes, and snippets.

@ku1ik
Last active June 24, 2017 16:19
Show Gist options
  • Save ku1ik/4cb9329a0331eab5c1ac95f971f64860 to your computer and use it in GitHub Desktop.
Save ku1ik/4cb9329a0331eab5c1ac95f971f64860 to your computer and use it in GitHub Desktop.
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