views:

260

answers:

1

In my en.yml translation file, I have:

activerecord:
  errors: 
    template: 
       header: 
         one: "1 error prohibited this {{model}} from being saved"
         other: "{{count}} errors prohibited this {{model}} from being saved"  

When an activerecord/validation error occurs during logging into my application, the error message:

"1 error prohibited this user session from being saved"

is displayed (where user_session is the model being used). I'd rather have it say something like

"An error has occured to prevent you from logging into your account".

How do I override the generic error message with my specific one?

A: 

You need to make your own FormBuilder and change it's translation key.

shingara
Thanks. I have a feeling there is an easier way to do it by adding addition entries into the translation file in the models and attributes section, but I haven't found anything that clearly explains how to do it. activerecord:->errors:->models: AND activerecord:->errors:->attributes:
David Smith