views:

26

answers:

0

I use Rails RESTful routing to generate URLs for one resource in my application. My resource ID contains some special characters. The confusing part is that in the generated URL, when I look in the HTML, is double escaped. For instance, /item/item+one get escaped to /item/item%252Bone instead of /item/item%2Bone.

When getting the ID parameter back from controller, it get escaped once though, so params[:id] returns item%2Bone in this case.

So my question is, what causes the double escaping in the beginning? What do I need to do in order to use the ID string as is and have the escaping/unescaping work as expected?