# Scaping URL-like strings in links

**URL:** <https://www.ruby-forum.com/t/scaping-url-like-strings-in-links/125626>\
**Category:** Rails\
**Created:** [January 10, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/scaping-url-like-strings-in-links/125626 "2008-01-10T19:03:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [January 10, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/scaping-url-like-strings-in-links/125626/1 "2008-01-10T19:03:27Z")

</div>

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](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.
