Last active
June 24, 2017 16:19
-
-
Save ku1ik/4cb9329a0331eab5c1ac95f971f64860 to your computer and use it in GitHub Desktop.
Nested layouts in Phoenix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Asciinema.DocController do | |
use Asciinema.Web, :controller | |
def show(conn, _params) do | |
conn | |
|> put_layout(:docs) | |
|> render("show.html") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="row"> | |
<div class="col-md-3"> | |
... | |
</div> | |
<div class="col-md-9"> | |
<%= render @view_module, @tpl %> | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= 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