Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to allow dynamic error messages in model validations #470

Closed
tapirus opened this issue Apr 10, 2015 · 4 comments
Closed

Possibility to allow dynamic error messages in model validations #470

tapirus opened this issue Apr 10, 2015 · 4 comments
Milestone

Comments

@tapirus
Copy link

tapirus commented Apr 10, 2015

Hi,
I would like to see the possibility to have dynamic error messages in model validations.
This would be useful for localization.
I know it is possible with plugins like
https://github.com/ellor1138/Localizator
but I would prefer to have this bit in the core functionality.

Regards
tapirus

@perdjurner
Copy link
Contributor

Can you give me an example please?

@tapirus
Copy link
Author

tapirus commented Apr 10, 2015

I found the corresponding thread I opened a while ago.
https://groups.google.com/forum/#!topic/cfwheels/bV6gPCTJhUU

@perdjurner
Copy link
Contributor

Ok, I think we can do a similar solution to what is done under "Evaluating Filter Arguments at Runtime" on http://cfwheels.org/docs/1-3/chapter/filters.

It would end up being something like this:
validatesPresenceOf(property="name", message="##application.errors.presenceOf[session.country].message##")

Where application.errors is a struct the developer sets up.

@tapirus
Copy link
Author

tapirus commented Apr 10, 2015

Cool! Thanks Per!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants