Torch.FlashView.flash_message

You're seeing just the function flash_message, go back to Torch.FlashView module for more information.
Link to this function

flash_message(conn, type)

View Source

Specs

flash_message(Plug.Conn.t(), type :: atom() | String.t()) :: Phoenix.HTML.safe()

Returns a formatted flash message of the given type.

Parameters

  • conn: The current Plug.Conn.
  • type: The flash type, such as :error.

Example

iex> conn = %Plug.Conn{private: %{phoenix_flash: %{"error" => "Error Message"}}}
...> flash_message(conn, "error") |> safe_to_string()
"<p class=\"torch-flash error\">Error Message <button class='torch-flash-close'>x</button></p>"