I have setup autocomplete in my application and I noticed during testing that it suddenly failed having just been working just moments before. The application returned a pg error claiming that the employee_id value was null.
I realized that the browsers native autocomplete had prompted me with the value and therefore the js
didn't insert the id value into the hidden field.
On checking the Mozilla documentation I see that they recommend turning off autocomplete at the form level. I am using simple_form but can't figure out how to do this.
<form name="form1" id="form1" method="post" autocomplete="off"
Just pass autocomplete
option to the :html
hash:
<%= simple_form_for @user, html: { autocomplete: 'off' } do |f| %>
<%= f.input :country, as: :string %>
<% end %>