I have a form object (rails 3) and I am trying to get use config/locales/en.yml
for the error messages.
My form object looks like this:
class Users::PasswordAndLoginUpdatingForm
include Virtus.model
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
attribute :requested_email_address, String
validates :requested_email_address, allow_blank: true, format: { with: User::VALID_EMAIL_REGEX }
In my form I have the usual
form_for @form_object ... do |f|
If I pry
in and find out what the f.object_name
is I get users_password_and_login_updating_form
Finally, my config/locales/en.yml
looks like this:
en:
activemodel:
errors:
models:
users_password_and_login_updating_form:
attributes:
requested_email_address:
invalid: "bar"
The issue I'm having is, I cannot get it to use the internationalization.