somekool wrote:
> it changes a quote for example into %xx but the second time, it remains
> %xx unchanged, cuz its ok

I think this is where the confusion is arising. There are two different
kinds of escaping going on.

It sounds like you're talking about the URL encoding that uses '%xx' to
represent special characters.

However, the html_escape function does something completely different.
It takes a string and turns '&' into '&amp;' and '<' into '&lt;', etc.,
so that it can go into HTML without being interpreted as literal '&'s
and '<'s.

Escaping special characters in URLs using the '%xx' scheme is
mandatory, otherwise they are not valid URLs.

But HTML-escaping using '&' can be turned off using the :escape =>
false option. Of course, you always want to HTML-escape the URL at some
point before outputting it in HTML. And most of the time it's okay to
let url_for do this for you. But sometimes you need to take the result
of url_for and pass it through another function that does its own
HTML-escaping. That's when you can make use of the :escape => false
option to url_for.

Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---

Reply via email to