I mean, URI.parse(uri) doesn't return any error on either of the URIs it seems.
Den söndagen den 29:e juli 2012 kl. 19:44:48 UTC+2 skrev Linus Pettersson: > > Thank you for your time. > > How can I check if the URL is "good" or needs to be encoded? > > Best Regards > Linus > > > Den söndagen den 29:e juli 2012 kl. 19:30:58 UTC+2 skrev Hassan Schroeder: >> >> On Sun, Jul 29, 2012 at 10:09 AM, Linus Pettersson > > > wrote: >> >> > I need to redirect to some 3rd party websites. The issue is that some >> of the >> > urls works to redirect and some doesn't work, using redirect_to url >> >> > So, I need an approach that works with both (all?) URIs. Any ideas? >> >> Write a utility method, e.g. redirect_to sanity_checked(url) that either >> returns the original URL if it's good or an encoded version if not. >> >> Which is not to say that simply encoding it will fix every error, so it's >> probably worth checking that result too :-) >> >> HTH, >> -- >> Hassan Schroeder ---------------------- >> http://about.me/hassanschroeder >> twitter: @hassan >> > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/R5v4pDnE-jcJ. For more options, visit https://groups.google.com/groups/opt_out.

