Comments (6)
Thanks for reporting this @keilmillerjr.
Do you want to send a PR ?
Thanks again!
from activevalidators.
I've been investigating a bit the other validators' behaviors and it seems they all behave the same and will throw an error if the field is blank. Have you tried something like validates :url, url: true, unless: :blank?
If this still doesn't work, I'll reopen the issue.
Thanks a lot!
from activevalidators.
I am getting the same error.
Tried using unless: blank?
but no luck.
from activevalidators.
FYI it doesn't work with unless: blank?
but it works fine with allow_blank: true
So you can write:
validates :link_url, url: true, allow_blank: true
It works for me with Rails 4.0
from activevalidators.
A note or example of this on the readme would be helpful.
from activevalidators.
Done. Thanks !
from activevalidators.
Related Issues (20)
- Line 2 of activevalidators.rb needs to be deleted HOT 5
- Is '[email protected], anything' a valid email?! HOT 11
- credit card validation HOT 5
- Host validator HOT 6
- Use check_validity! to ensure passed parameters on all validators
- Fix the build on rbx HOT 1
- Country gem's Country class name clashes with frequently-used Country class name in projects HOT 4
- date validator require not working - bounces back HOT 6
- "can't dup nilClass" error in testing with shoulda HOT 3
- Where should I put ActiveValidators.activate(:all)? HOT 1
- http:bla passes url validation HOT 1
- Default error messages HOT 1
- initializer warning HOT 2
- Date validation breaks, maybe because of ActiveAdmin datepicker HOT 2
- Postal code validator creates `undefined method 'match' for 12345:Fixnum` HOT 6
- [deprecated] ActiveValidators.activate is the recommended solution to require your validators. Please check instructions in the README. Thanks a lot ! HOT 3
- TLD support for url validator HOT 3
- http://mywebsite. passes url validation HOT 3
- SIN Validator not handling 000 000 000 HOT 2
- All URLs containing non-ASCII characters are considered invalid HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activevalidators.