Executive summary:
:escape => false is only used in UrlHelper's :url_for. It is not
passed to RoutSet's :generate, and thus not to the Route or its
Segments. Thus, regardless of the :escape setting, generating a URL
from a route (named or otherwise) will always escape each segment, and
thus the whole path.
Problem in detail:
I have a Tag class, and I'd like routes like
/tags/java
/tags/c++
etc.
The problem comes in with tags that have a period, forward-slash,
question mark, or octothorp in them, since any of those can indicate
the end of a path segment. Thus, I have
class Tag ...
def to_param
URI::encode self.name, /[\/.?#]/
end
end
The problem is that the resulting %xy is always double-escaped to
%25xy.
Possible solutions:
1. pass :escape to Segment. I believe the offending method is
DynamicSegment's :interpolation_chunk.
2. do no escaping in Segment; only do escaping in UrlHelper and/or
UrlWriter.
I'm not sure of the ramifications of either. Suggestions?
-Gaius
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---