Skip to content

Commit b0fe7ec

Browse files
authored
Update controllers documentation (#6416)
1 parent a5646df commit b0fe7ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

guides/controllers.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,14 @@ If we wanted to render an XML version of our `home` action, we might implement t
262262
def home(conn, _params) do
263263
conn
264264
|> put_resp_content_type("text/xml")
265+
|> put_format(:xml)
265266
|> render(:home, content: some_xml_content)
266267
end
267268
```
268269

269-
We would then need to provide an `home.xml.eex` template which created valid XML, and we would be done.
270+
Then we would need to provide a `home.xml.eex` template that creates XML and a `PageXML` view that embeds the template, and that would be it.
271+
272+
Note: The `home.xml.eex` template uses the `.eex` extension. `.eex` templates are rendered by [`EEx`](https://hexdocs.pm/eex/main/EEx.html).
270273

271274
For a list of valid content mime-types, please see the `MIME` library.
272275

0 commit comments

Comments
 (0)