Phoenix.View.render_one/4

Parsed documentation:
View on GitHub
Renders a single item if not nil.

The following:

    render_one user, "show.html"

is roughly equivalent to:

    if user != nil do
      render(UserView, "show.html", user: user)
    end

When a view is not given, it is automatically inflected
from the given struct. The underlying user is passed to
the view and template as `:user`, which is inflected from
the view name. The name of the key in assigns can be
customized with the `:as` option:

    render_one user, "show.html", as: :data

is roughly equivalent to:

    if user != nil do
      render(UserView, "show.html", data: user)
    end

Overall, this function has four signatures:

    render_one(model, template)
    render_one(model, template, assigns)
    render_one(model, view, template)
    render_one(model, view, template, assigns)
Suggestions:
Please help! Open an issue on GitHub if this assessment is incorrect.