Pergunta

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?

Foi útil?

Solução

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

Panayotis

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top