views:

16

answers:

1

I write code in English but I'm currently doing a site which is fully translated to another language (validation error messages included). However, I have a problem because validation error messages always seem to include the name of the attribute the error is on at the start of the error, e.g.:

Title Prosimo izpolnite naziv fakultete.

I want to get rid of the Title at the start, like so:

Prosimo izpolnite naziv fakultete.

Any help is appreciated. I would rather see if this can be solved without installing any 3rd party plugins. If it's possible to provide translations for attribute names, that would be a cool solution too, but I would still like to know how it can be done both ways (omit or translate).

A: 

There is no need to use the error_messages_for helper for errors, you can write your own helper using the record's errors attribute.

You can just iterate over the error objects and display their messages.

Maz
Thanks. I looked up the code of error_messages_for from rails source and used that as a base, for anyone who might need to do this.
mrbrdo