The call :application.get_env returns a tuple in the format:
{:ok, '1.0.0'}
Phoenix.HTML.Safe does not have a function to decode a tuple in this format ( source ). You will need to extract the version from the call:
<%= :application.get_key(:phoenix, :vsn) |> elem(1) %>
However, a better way would be to use a helper function:
defmodule VersionHelper do def version do case :application.get_key(:phoenix, :vsn) do {:ok, vsn} -> vsn _ ->
This can then be called in your view using VersionHelper.version - this means that the version selection is not tied to the key that the phoenix uses in the view.
source share