Skip to main content

Rails Tip: Safe Usage of URI.parse

Blog post   •   Jan 26, 2010 13:41 GMT

As documented already by Doug URI.parse will thrown an exception if your URL has a trailing space. It also throws an exception on invalid URLs in general. To avoid having URI.parse bomb on your pages you can use a construct like this:


Comments (1)


    Thanks for such a knowledgeable post.

    <a href="">Airultech</a>

    - Market Research Vietnam - May 18, 2016 06:19 GMT

Add comment