In html, the preliminary text in the input is called the placeholder attribute.
You can add this attribute to the tagged fields of form_for :
<%= f.text_field :some_data, :placeholder => "value" %>
BUT, when executing the placeholder attribute, beware that it is not fully supported in older versions of some browsers. Therefore, often some JS is required to polyphilize this functionality ... you should take care of this if you do not use traditional labels next to input fields.
source share