Forum: Ruby on Rails URL encoding in Rails?

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.
Wes G. (Guest)
on 2006-05-01 19:05
Simple question:

How does one do URL encoding in Ruby/Rails?

Thanks,
Wes
Ed L. (Guest)
on 2006-05-02 04:09
Wes G. wrote:
> Simple question:
>
> How does one do URL encoding in Ruby/Rails?
>
> Thanks,
> Wes

Check out CGI.escape(). CGI is part of the Ruby standard library.
Typically you'll want to pass in just a querystring parameter value (not
the entire URI).

--Ed
Doug D. (Guest)
on 2006-05-02 22:26
And CGI.escape_skipping_slashes added in Rails' Active Supprt. It's good
for a pathname, but not for a URL with hostname.

DD

Ed Lau wrote:
> Wes G. wrote:
>> Simple question:
>>
>> How does one do URL encoding in Ruby/Rails?
>>
>> Thanks,
>> Wes
>
> Check out CGI.escape(). CGI is part of the Ruby standard library.
> Typically you'll want to pass in just a querystring parameter value (not
> the entire URI).
>
> --Ed
Charlie B. (Guest)
on 2006-05-03 20:57
(Received via mailing list)
That's a very vague question.

Simple Answer:
routes.rb
Scott W. (Guest)
on 2006-05-03 20:57
(Received via mailing list)
Try:
CGI::escape('scott walter')

You may need to require "CGI"

scott.

----------------------------------------------------------------------------------------------------
What's an Intel chip doing in a Mac? A whole lor more that it's ever
done in a PC.

My Digital Life - http://scottwalter.com/blog
Pro:Blog - http://scottwalter.com/problog

----- Original Message ----
From: Wes G. <removed_email_address@domain.invalid>
To: removed_email_address@domain.invalid
Sent: Monday, May 1, 2006 10:05:08 AM
Subject: [Rails] URL encoding in Rails?

Simple question:

How does one do URL encoding in Ruby/Rails?

Thanks,
Wes
This topic is locked and can not be replied to.