Frage

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?

War es hilfreich?

Lösung

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

Panayotis

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top