开发者

Rails 3 EachValidator for URLs

开发者 https://www.devze.com 2023-03-15 06:19 出处:网络
I want to create an EachValidator that I can use to test the validity of a given URL. Basi开发者_StackOverflow中文版cally I would like to first test if it matches a URL format. If it appears to be a U

I want to create an EachValidator that I can use to test the validity of a given URL. Basi开发者_StackOverflow中文版cally I would like to first test if it matches a URL format. If it appears to be a URL then use Net::HTTP to try and resolve the URL (including following redirects). Has anyone out there already done similar to this and would be willing to share their code?


Check out https://gist.github.com/948880

0

精彩评论

暂无评论...
验证码 换一张
取 消