ruby on rails - how to put an URL as a parameter in another URL for successful parsing -


say want set url: www.a.com?str1=12&str2=67 parameter in url can parsed properly.

problem: set parameter in url as-

www.a.com?redirect_to=www.a.com?str1=12&str2=67 

then happens when parse url value of redirect_to www.a.com?str1=12 because strt2 considered parameter. can www.a.com?str1=12&str2=67 value of redirect_to?

try escaping redirect url cgi.escape:

require 'cgi' my_url = "www.a.com?redirect_to=#{cgi.escape('www.a.com?str1=12&str2=67')}" # my_url => "www.a.com?redirect_to=www.a.com%3fstr1%3d12%26str2%3d67" 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -