title: Nested attributes form error message customization
body: <p>I have the following model   </p>
  
  <pre><code>class OrgPerson &lt; ActiveRecord::Base
      has_and_belongs_to_many :TypRole
      has_and_belongs_to_many :OrgContact
      has_one :OrgCredential, dependent: :destroy
      belongs_to :OrgCompany, foreign_key:"org_company_id"
      belongs_to :TypPosition, foreign_key:"typ_position_id"
      validates :first_name, presence: true
      validates :last_name, presence: true
      accepts_nested_attributes_for :OrgCredential
  end
  
  class OrgCredential &lt; ActiveRecord::Base
      belongs_to :OrgPerson, foreign_key:"org_person_id"
      validates :user_name, presence: true
      validates :password, length: { minimum: 6 }
      before_create :create_remember_token
      has_secure_password
  end
  </code></pre>
  
  <p>and the following strong parameters: </p>
  
  <pre><code>def person_params
    params.require(:org_person).permit(:first_name, :last_name, 
      org_credential_attributes: [:password, :password_confirmation])
  
  end
  </code></pre>
  
  <p>and the following new.html.erb</p>
  
  <pre><code>    &lt;%= form_for(@person) do |f| %&gt;
      &lt;%= render 'shared/error_messages' %&gt;
      &lt;div class="col-md-12 "&gt;
        &lt;%= f.text_field :first_name, placeholder: "First Name", :class =&gt; "form-control" %&gt;
        &lt;%= f.text_field :last_name, placeholder: "Last Name", :class =&gt; "form-control" %&gt;
        &lt;%= f.fields_for :org_credentials do |oc|%&gt;
              &lt;%= oc.password_field :password, placeholder: "Password", :class =&gt; "form-control" %&gt;
              &lt;%= oc.password_field :password_confirmation, placeholder: "Password Confirmation", :class =&gt; "form-control" %&gt;
        &lt;% end %&gt;
      &lt;%= f.submit "Create my account", class: "btn btn-large btn-primary" %&gt;
      &lt;/div&gt;
  </code></pre>
  
     
  
  <p>In shared/error_messages</p>
  
  <pre><code> &lt;% if @person.errors.any? %&gt;
       &lt;div id="error_explanation" class="col-md-12"&gt;
         &lt;div class="alert alert-danger" role="alert"&gt;
           The form contains &lt;%= pluralize(@person.errors.count, "error") %&gt;.
         &lt;/div&gt;
         &lt;ul&gt;
         &lt;% @person.errors.full_messages.each do |msg| %&gt;
           &lt;li&gt;* &lt;%= msg %&gt;&lt;/li&gt;
         &lt;% end %&gt;
         &lt;/ul&gt;
       &lt;/div&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/jnAk9.png" alt="enter image description here"></p>
  
  <p>The problem as shown in the picture is that it says something like "Org credential password is too short" when I only want it to say "Password is too short." I'm quite new to rails and I feel like I have to iterate through the error hash to spit out "Password is too short," but i'm not quite certain if this is the only way to do it or if there is an easier way. I hope someone who may have ran into the same problem can enlighten me on how they solved it.</p>
  
  <p>Thank you!  </p>