I am using Rails 3.2.6 and this is an example:
class Man < ActiveRecord::Base has_many :eyes accepts_nested_attributes_for :eyes end class Eye < ActiveRecord::Base belongs_to :man validates_inclusion_of :color, in: { %w[brown green blue] } end
Views (in HAML):
= form_for @man do |f| - if @man.errors.any?
it.yml:
it: activerecord: attributes: customer: eyes: Occhi customer/eyes: color: Colore errors: models: man/eyes: attributes: color: inclusion: non valido
However, the color label is not translated (but using actviterecord.attributes.eye.color), the attribute in the error message is only βOcchiβ, and the remaining errors.model.eyes.attributes.color.inclusion instead of errors.models.man/eyes.attributes.color.inclusion
The error message is errors.model.man.attributes.eyes.inclusion , but how can I distinguish it? It should be something like "Occhi Colore non valido" instead of "Occhi non valido"
Iazel source share