ActiveModel: different messages to check for viewing

I use the same model in two views (containing forms), and I want to provide different validation messages for each view. Example:

View 1:

Please fill in this bla bla

View 2:

Fill in foo foo

I followed the i18n manuals to override the default error messages for the model, but I cannot find a way to differentiate them for each view.

Is it possible?

+3
source share
1 answer

IMHO, you must use two different viewing models. Therefore, you will have two classes / models with a single responsibility.

Panagiotis

+1
source

All Articles