如何关闭 Elixir/Phoenix 中表单输入的自动完成功能?

How do I turn off autocomplete for the inputs in a form in Elixir/Phoenix?

例如,需要如何更改才能防止在名称字段中自动完成?

<%= form_for @changeset, @action, fn f -> %>
  <%= label f, :name %>
  <%= text_input f, :name %>
  <%= error_tag f, :name %>
<% end %>

您可以只为表单和 text_input 设置 autocomplete: "off"

<%= form_for @changeset, @action, [autocomplete: "off"], fn f -> %>
  <%= label f, :name %>
  <%= text_input f, :name, autocomplete: "off" %>
  <%= error_tag f, :name %>
<% end %>