georges
georges

Reputation: 282

How to have url not encoded in rails

I don't understand why all my special characters in my url are encoded for example :

new_subscription_url(:session_id => '{CHECKOUT_SESSION_ID}' )

Give me

http://localhost:3000/en/subscriptions/new?session_id=%7BCHECKOUT_SESSION_ID%7D

All special characters are encode. How could I have them not encoded ?

Upvotes: 0

Views: 63

Answers (1)

Fernand
Fernand

Reputation: 1333

It is not encoded but rather escaped.
According to Internet standard (IETF section 2.4), URI is always in an "escaped" form.

On the side note, if you want to unescape it, you can use

CGI::unescape(new_subscription_url(session_id: '{CHECKOUT_SESSION_ID}' ))

Upvotes: 1

Related Questions