-
Notifications
You must be signed in to change notification settings - Fork 404
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Application Defined Messages Not Being Used #225
Comments
OK, dug a little deeper. I'm thinking this is caused by a translation issue. Possibly. On line 14 of client_side_validations/active_model/length.rb
from the console, I run:
|
OK, figured out a fix, but I think it's still a bug. At least it's not the behavior I'd expect. If I specify the error message in en.yml it's picked up by client_side_validations. So the gem is ignoring messages defined as options in the validation methods themselves and instead looking in the localization file, even though I'm not using I18n. This is a different behavior from the validation in the Rails code, which picks up the :message option. If this is the expected behavior it should probably be documented in the wiki. If not, I'm happy to look into a fix. Also, I don't want to seem too critical. This gem is great and I'm very happy with it. Thanks for making it! |
Yes, this is a bug. Thank-you. Sorry it took so long for me to get to it. |
Hi,
I'm using Rails 3.0.5 and client_side_validations 3.0.5. I'm seeing the default Rails error message displayed instead of my custom error messages.
Code:
When the address1 field fails client-side validation, the default message "is too short..." displays instead of my defined message "Address must be ...". If I submit the form so the page reloads with errors, the error I specified is correctly displayed next to the field. But as soon as I modify the field and validation fails again, the default error is again rendered.
Please let me know if this is expected behavior. If not I'll dig deeper.
Thanks,
Gabe
The text was updated successfully, but these errors were encountered: