The answers to how do I use a default placeholder ... in a select_tag? show how to set a default value for the select field.
<%= f.select :country, countries, {include_blank: true, prompt: "United States"}, {required: true, class: "form-control"} %>
The problem here is that I only want the silhouette of the placeholder, not an actual value that could accidentally be submitted.
If we compare to the placeholder value in a text_field, the difference is much more clear. We see the placeholder:
But we cannot accidentally submit the placeholder.
How can I get similar behaviour with the .select field?
That is, so that there is some placeholder in the select field, but so it cannot be accidentally submitted?



According to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select a
selecthas noplaceholderoption. If you wish to show a predefined value that should not be submitted you can add adisabledoption to this specific item and combine it withselected.