Forum: Ruby on Rails Url encoding Help Pls!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bing (Guest)
on 2006-05-30 20:38
Hi guys,

it's me again, I want to come up with the following url:

www.mysite.com/webpage?myid=1

I keep coming up with the following url:

www.mysite.com/webpage%3Fmyid%3D1

require 'uri'
$myurl = URI.escape("webpage?myid=")
redirect_to(:action => $myurl + 1 )

what am I doing wrong?

I also tried
require 'cgi'
$myurl = CGI::unescape("webpage?myid=")
redirect_to(:action => $myurl + 1 )

oh no, what's going wrong? Also, on top of that, can you help what the
difference between CGI and URI is?

thanks in advance,

Bing
Ole Christian Rynning (Guest)
on 2006-05-31 02:02
(Received via mailing list)
Don't know if this is helpful or not, but try something like this
instead:

id = 1
@myurl = "http://www.website.com/?myid=#{id}")
redirect_to @myurl

oc


Bing wrote:
> require 'uri'
> oh no, what's going wrong? Also, on top of that, can you help what the
> difference between CGI and URI is?
>
> thanks in advance,
>
> Bing
>
>


--
A | c/o Marie Eikrem, Fagerborggt 48A, NO-0360 OSLO
M | +47 411 44 384
W | http://www.foo.mu
This topic is locked and can not be replied to.