How to set layout after put_format?

conn
|> put_format("mobile.html")
|> put_resp_content_type("text/html; charset=utf-8")

I try put_layout, don’t work.

conn
|> put_format("mobile.html")
|> put_layout({MyAPP.LayoutView, "app.mobile.html"})
|> put_resp_content_type("text/html; charset=utf-8")

I find put_layout_formats/2, It’s work

1 Like