smhauck
(Shannon M. Hauck)
March 18, 2025, 4:39am
1
Any idea why the sessions/new.html.erb users autocomplete: “username” for the email field? I’m trying to add a separate username field and it’s behaving strangely. Can I change it to autocomplete: “email_address” ?
Thanks!
<%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: “username”, placeholder: “Enter your email address”, value: params[:email_address] %>
<%%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
<%%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %>
<%%= form_with url: session_path do |form| %>
<%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %><br>
<%%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72 %><br>
<%%= form.submit "Sign in" %>
<%% end %>
<br>
<%%= link_to "Forgot password?", new_password_path %>
You can change it to “email”