it works the same. I mean, it's great Rails encode URLs automatically,
but if there is no need (as in this case)...
PT 1: the "manual" URL "queries/vlan_interfaz=Trial" works even thoug
with query params such as "queries/vlan_interfaz=Trial?page=3". This is
the reason why I say here there is no need in encoding.
PT 2: With a simple <a href=...> it does not happen. I would use this
way but my_transf(@value), a method that encodes "@value", returns the
value as it is too, not encoded... :S
maybe it has to do with the routing and the kind of action. eg my
example worked on the index action, which does not need an id parameter.
your sdrs_query_path (singular path) should call the show action and
therefore expect the id as first parameter. in this case it may handle
things different.
or there are differences in the rails versions? i simply can't reproduce
it in the way it works for you...
PT 1: the "manual" URL "queries/vlan_interfaz=Trial" works even thoug
with query params such as "queries/vlan_interfaz=Trial?page=3". This
is
the reason why I say here there is no need in encoding.
= is a reserved character in paths according to http://www.ietf.org/rfc/rfc2396.txt
3.3
which probably means you shouldn't use it like that. 'It works' isn't
usually a good test for these sort of things. You may be relying upon
quirks of one particular web browser, server etc...
Hi all,
yes, you're right, and I can try with another character.
The thing is that, for example, the character "|" is not a reserved
character in paths (I think), but Rails also encodes it.
My Rails version is 1.2.5. I can reproduce your example programming an
"<a href=..." directly, but not with link_to. Link_to always encode my
characters.
In fact I am not 100% sure it is technically a reserved character there. Let me explain.
The RFC says you first need to split the URL apart, and then interpret reserved characters _depending on the part of the URL you are dealing with_. My interpretation as far as "=" is concerned is that first you would split the URL by "?" and then interpret "=" in the query string. Since AFAIK there's no special meaning for "=" to the left of the question mark I think technically it is not required to be escaped.