.

Coffee Powered

code and content

Tag Archives: uri

Quick tip: Strip URLs before parsing!

Rather than roll my own URL regexes, I prefer to let the existing libraries do the heavy lifting. Ruby has a uri library which is fantastic for parsing (and validating) URLs. For example, something like this might be used in a model validation: I noticed a bit ago that I started getting invalid URL errors [...]