How does one encode URLs in ROR? Thanks Frank --------------------------------- Bring words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/60280869/attachment.html
require ''base64'' Base64.encode64(url) adam On 1/30/06, softwareengineer 99 <softwareengineer99@yahoo.com> wrote:> How does one encode URLs in ROR? > > Thanks > Frank > > > ________________________________ > Bring words and photos together (easily) with > PhotoMail - it''s free and works with Yahoo! Mail. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Thank you Adam for your reply. If I am encoding a string "l o p o", then the Base64.encode64 will convert it to bCBvIHAgbyA=. I am looking for a function similar to PHP''s urlencode which will convert "l o p o" to "l+o+p+o" or "l%20o%20p%20o" Thanks Frank Adam Denenberg <straightflush@gmail.com> wrote: require ''base64'' Base64.encode64(url) adam On 1/30/06, softwareengineer 99 wrote:> How does one encode URLs in ROR? > > Thanks > Frank > > > ________________________________ > Bring words and photos together (easily) with > PhotoMail - it''s free and works with Yahoo! Mail. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/78d02d9f/attachment.html
I found the answer. Use <%= u("l o p o ") %> Thanks Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: Thank you Adam for your reply. If I am encoding a string "l o p o", then the Base64.encode64 will convert it to bCBvIHAgbyA=. I am looking for a function similar to PHP''s urlencode which will convert "l o p o" to "l+o+p+o" or "l%20o%20p%20o" Thanks Frank Adam Denenberg <straightflush@gmail.com> wrote: require ''base64'' Base64.encode64(url) adam On 1/30/06, softwareengineer 99 wrote:> How does one encode URLs in ROR? > > Thanks > Frank > > > ________________________________ > Bring words and photos together (easily) with > PhotoMail - it''s free and works with Yahoo! Mail. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars._______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/1dcbcba9/attachment-0001.html
try this require ''uri'' val = URI.escape("my parameter value") adam On 1/30/06, softwareengineer 99 <softwareengineer99@yahoo.com> wrote:> Thank you Adam for your reply. > > If I am encoding a string "l o p o", then the Base64.encode64 will convert > it to bCBvIHAgbyA=. > > I am looking for a function similar to PHP''s urlencode which will convert > "l o p o" to "l+o+p+o" or "l%20o%20p%20o" > > > Thanks > Frank > > Adam Denenberg <straightflush@gmail.com> wrote: > require ''base64'' > Base64.encode64(url) > > adam > > On 1/30/06, softwareengineer 99 wrote: > > How does one encode URLs in ROR? > > > > Thanks > > Frank > > > > > > ________________________________ > > Bring words and photos together (easily) with > > PhotoMail - it''s free and works with Yahoo! Mail. > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ________________________________ > Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new > and used cars. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >