title: How to internationalize (I18n) generic error messages on a failed validation in Rails 3.1?
body: <p>I would like to be able to provide internationalized, helpful error messages.</p>
  
  <p>I have a generic error message partial view rendering for a nested form submission</p>
  
  <pre><code>    # _error_messages.html.erb - Fragment
      ...
  
      &lt;strong&gt;&lt;%= t('errors.template.body') %&gt; &lt;/strong&gt;       
      &lt;ul&gt;
        &lt;% object.errors.full_messages.each do |msg| %&gt;
          &lt;li&gt;&lt;%= msg %&gt; &lt;/li&gt;
        &lt;% end %&gt;
      &lt;/ul&gt;
  
      ...
  </code></pre>
  
  <p>I get the internationalized body message, however, I cannot figure out how to replace the attribute or, more specifically, the ":blank" error for that model field (i.e., validates_presence_of :name) validation despite numerous yaml iterations.</p>
  
  <p>Here is a fragment from my yaml</p>
  
  <pre><code>en:
    errors: &amp;errors
      format: ! '%{attribute} -- %{message}'
        messages:
          accepted: must be accepted
          blank: must not be blank
          body: ! 'There were problems with the following fields:'
  
  
      activemodel:
          attributes:
            family_wizard: 
              children: kids
  </code></pre>
  
  <p>And I wrote the yaml like that because when I inspect the error object passed to the partial when I leave the child's name field blank (:validates_presence_of :name) looks like this:</p>
  
  <pre><code>#&lt;ActiveModel::Errors:0x007111111C111111 @base=#&lt;FamilyWizard id: nil, ...&gt;, 
      @messages {:children=&gt;["must not be blank"]}&gt;
  </code></pre>
  
  <p>But the only error message I can get out is:</p>
  
  <p><strong>There were problems with the following fields:</strong></p>
  
  <ul>
  <li>Children -- must not be blank</li>
  </ul>
  
  <p>An ideal solution error message would look like this:</p>
  
  <p><strong>There were problems with the following fields:</strong></p>
  
  <ul>
  <li><strong>Kids</strong> -- <strong>the name</strong> must not be blank</li>
  </ul>
  
  <p>This Stack Overflow question (<a href="https://stackoverflow.com/questions/14536518/how-to-localize-a-generic-error-messages-partial-in-rails-3-2-3">How to localize a generic error messages partial in Rails 3.2.3?</a>) was on the right track, but it's missing the activemodel/activerecord validation part I would like. </p>