Custom validation error messages

Hi, I tried putting some custom validation error messages because my model messages are not very good.

ie. Catiddesc can’t be blank

so i put this after my validation, :message => “Category ID description is required.”

and rails returns

Catiddesc Category ID description is required.

what is that? I’m trying to replace the error message with my own. How do I remove that model name.

You have to provide a translation for the attribute, see Rails Internationalization (I18n) API — Ruby on Rails Guides on how to do that.

1 Like

Thanks, I’ll look into that.