Ruby on Rails: How do I add placeholder text to a f.text_field?
In Rails 4(Using HAML):
=f.text_field :first_name, class: 'form-control', autofocus: true, placeholder: 'First Name'
With rails >= 3.0, you can simply use the placeholder
option.
f.text_field :attr, placeholder: "placeholder text"