Skip to content

Commit

Permalink
Merge pull request phoenixframework#100 from bcardarella/patch-1
Browse files Browse the repository at this point in the history
Use correct argument value for put_layout/2
  • Loading branch information
lancehalvorsen committed Dec 23, 2014
2 parents b4e26e6 + 7c825df commit 3805ff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion D_controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Since layouts are really just templates, they need a view to render them. This i

Before we create a new layout, though, let's do the simplest possible thing and render a template with no layout at all.

The `Phoenix.Controller.Connection` module provides the `put_layout/2` function for us to switch layouts with. (Note: in release 0.4.1 and earlier, this was `assign_layout/2`.) This takes `conn` as its first argument and a string for the basename of the layout we want to render as the second. Another clause of the fuction will match on the atom `:none` for the second argument, and that's how we will render the Phoenix welcome page with no layout at all.
The `Phoenix.Controller.Connection` module provides the `put_layout/2` function for us to switch layouts with. (Note: in release 0.4.1 and earlier, this was `assign_layout/2`.) This takes `conn` as its first argument and a string for the basename of the layout we want to render as the second. Another clause of the fuction will match on the boolean `false` for the second argument, and that's how we will render the Phoenix welcome page with no layout at all.

In a freshly generated Phoenix app, edit the index action of the `PageController` module to look like this.

Expand Down

0 comments on commit 3805ff5

Please sign in to comment.