Currently, Rails' I18n system automatically looks up localized text for <label> tags. It would be nice if it did something similar for the HTML5 placeholder attribute.
Your en.yml file would like this:
Your ERB would look the same:
<%= f.text_field :first_name %>
Your HTML would look like this:
<input id="person_first_name" name="person[first_name]" placeholder="John" type="text" />
Currently, you have to clutter up your markup like so:
<%= f.text_field :first_name, :placeholder => t('helpers.placeholder.person.first_name') %>
Peter De Berdt
It seems a good idea to me and creating a ticket and a patch for the
feature is the best way to get the Rails Core team to consider it in
P.S. - plus if it gets accepted, you have a nice little bragging right
for "I have contributed to the source code for Rails"
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at