Question

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

View 1:

Please fill in this bla bla

View 2:

Fill in foo foo

I followed the i18n guides to override the default error messages for the model but I can't find a way to differentiate them per view.

Is this possible?

Was it helpful?

Solution

IMHO, you should be using two different view models. Hence, you will have two classes/models with Single Responsibility.

Panayotis

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top