Have a highly specific, yet custom validation for a particular field on one of your Rails model objects? Don’t want to create a ActiveModel::Validator type? Not a problem!
You can just as easily create a method that can be invoked as part of the validation process. For example, imagine a field dubbed uri in some model object; this field must begin with a protocol (i.e. http or https). You can create a validation method like so:
1 2 3 4 5 | |
This method resides in your model. You can then register this method as a validation for your model like so:
1
| |
Now if the uri field doesn’t contain http or https, model.save will return false. Done!
Long running web requests are bad. They create resource contention among other waiting incoming requests; what’s more, with HTTP servers like
I recently found myself implementing both an Android and iOS
Curious to see what all the
Anyone ever told you that your website isn’t mobile optimized? Or have you ever seen a lilliputian-looking website on your device? You know, one that renders so small you are forced to squint as you enlarge various parts of the site with your fingers just to read it?
Over the past year and a half, I’ve watched
There has been a lot of excitement in recent months regarding a few new entrants to the mobile operating systems arena including 