-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error messages #4
Comments
I'm not familiar enough with the latest i18n to hazard a guess and I'm a bit swamped at the moment to launch a full-scale investigation. If I had the error in my app I would change my validation-scopes and rails gems to local clones of the git repos and start printlining the areas of the code responsible for pulling these error codes. If you have a public repo with an app that demonstrates the problem (or simply a failing test case!) I could probably hone in on the problem fairly quickly, without that it's a bit too much setup for me to undertake right now. |
Hi Gabe :) Stumbled upon this while trying to figure out the same thing in Rails 4.2.1 with your gem; so I thought I'd leave a comment for others since this issue is open anyway. I ended up just using ActiveRecord translations for ActiveModel:
|
Hi, Just starting trying to use this gem and I've ran into this problem straight away too. Can you explain the meaning of:
and:
In your yml file above? I've tried:
Which translates the attribute number in a normal validation but doesn't work with this gem. |
Aha, I see. The default error validation looks up:
But this gem looks up:
(which I found by using the excellent https://github.com/fphilipe/i18n-debug) I still don't understand the meanings of the &model_errors and *model_errors |
@samstickland &model_errors and *model_errors are just YAML anchors and aliases. You can read about them here: |
Thanks! 2015-08-21 8:31 GMT+01:00 Kris Khaira [email protected]:
|
This library is great, especially since you fixed the memory leak! So thanks for all your hard work. Just have one problem and I'm not sure how to work out where it's going wrong...
For my usual validations I can configure error messages via locales e.g. in my config/locales/en.yml I have:
Now the problem is, while for any attributes with normal validations I get the error message I want ('foo is missing'), for any attributes that I validate in a validation_scopes block, I get the standard error message ('bar can't be empty') - ignoring my locale file.
I looked in the source and I couldn't see why this would be. Any ideas?
The text was updated successfully, but these errors were encountered: