I've tried following the posts found here: Rails 3 Change Error Message and here: ActiveRecord validates... custom field name but neither has worked for me and my database field names still are displayed.
For example I get: Name is too short (minimum is 1 characters)
Any thoughts/Is there a preferred way to troubleshoot this? Thanks.
Here is what I have using the first linked article in my en locale:
en:
activerecord:
models:
account: "Account"
attributes:
order:
name: "Business Name"
Here is a bit of my account model:
validates_presence_of :name
validates_length_of :name, :minimum => 1, :maximum => 100
attr_accessible :name, :admin_attributes, :image
After a failed save attempt on the account, here is the code to display errors from my view:
<% if @account.errors.any? %>
<div class="errorExplanation">
<h2>Errors encountered with your account information:</h2>
<ul>
<% @account.errors.full_messages.each do |m| %>
<li><%= m %></li>
<% end %>
</ul>
</div>
<% end %>