This was filed as:
<https://rails.lighthouseapp.com/projects/8994/tickets/6080-i18n-support-for-html5-placeholder-attribute>
…and Aditya Sanghi suggsted I post to the list about it

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:

helpers:
 placeholder:
  person:
   first_name: "John"
   last_name: "Doe"

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') %>





Paul

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to