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

Custom error message #8

Open
anthony-robin opened this issue Jun 9, 2016 · 3 comments
Open

Custom error message #8

anthony-robin opened this issue Jun 9, 2016 · 3 comments

Comments

@anthony-robin
Copy link

I think it could be a good idea to add a section in README explaining how to add a custom I18n error message when URL validation failed

@oprema
Copy link

oprema commented Aug 31, 2016

I have the same problem and could not figure it out. Any help is very appreciated.

@paulcsmith
Copy link

I know this is very late, but I did this and it worked: url: { message: I18n.t('path.to.custom.error.message') }

@threedaymonk
Copy link

It would be better if the line

record.errors[attribute] << (options[:message] || "is an invalid URL")

were changed to

record.errors.add attribute, :invalid_url, options

as the error message could then be customised and localised in the normal Rails way.

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

No branches or pull requests

4 participants