Phoenix: Add flash message support to redirect

Created on 6 Mar 2015  路  2Comments  路  Source: phoenixframework/phoenix

Do we want to add flash support on redirect? For example:

redirect conn, to: path(...), notice: "User created with success"

If so, which keys do we want to use?

Most helpful comment

We decided to keep flash as functional composition with redirtect, and use :info / :error, ie:

conn
|> put_flash(:info, "it worked!")
|> redirect(to: "/")

All 2 comments

Btw, my vote is yes, because it is much more concise. I have no idea if we want to go with notice/alert though. We need to choose something anyway to use in "scaffold".

We decided to keep flash as functional composition with redirtect, and use :info / :error, ie:

conn
|> put_flash(:info, "it worked!")
|> redirect(to: "/")
Was this page helpful?
0 / 5 - 0 ratings