Scaping URL-like strings in links

Hi you all,
I have a model whose one of its attributes has a URL-like string value.
I want to do searches by this URL, so I can have a link pointing at:
bugs/by/uri/{value},
where value can be:/whatever.net/bla/bla

When you are over the link, you can see the link has turned into:
http://localhost:3005/bugs/by/uri/%2Fwhatever.net%2Bla%2Bla

However, when I click on it I get an error:
no route found to match "/sdrs/by/uri//whatever.net/bla/bla" with
{:method=>:get}

So… is there any method to scape the “/” (and possibly the dots ‘.’)
automatically?
URI.scape does not make any difference regarding the default behaviour.