We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello !
I'd like to call validates_url inside a method. Is it possible to do it ?
validates_url
With this test code, it raises undefined method.
validate :my_validation def my_validation validates_url(:url) && other validation && other validation end
Thanks a lot
The text was updated successfully, but these errors were encountered:
Yes, if you will initialize validator yourself. But you don't want to do that in 99%. What is your case?
Sorry, something went wrong.
Thanks for your quick anwser.
I have field, external link, that can be an URL, a mailto:... or a tel:....
mailto:...
tel:...
I'd like to create a custom method and use your validates_url method when it's an URL. Something like :
def my_validation validates_url(:url) || url.start_with?("mailto:") || url.start_with?("tel:") end
No branches or pull requests
Hello !
I'd like to call
validates_url
inside a method. Is it possible to do it ?With this test code, it raises undefined method.
Thanks a lot
The text was updated successfully, but these errors were encountered: