Hi all,
<%=link_to_remote “A”, :url => attendee_path(:id => 1 , :event_id =>
event.id, :present => ‘1’) %> results in A. For some
reason amp; appears in the url.
Someone knows why this happenes?
Thanks in advance
Stijn
Hi all,
<%=link_to_remote “A”, :url => attendee_path(:id => 1 , :event_id =>
event.id, :present => ‘1’) %> results in A. For some
reason amp; appears in the url.
Someone knows why this happenes?
Thanks in advance
Stijn
On Nov 22, 2007 8:59 AM, Tarscher [email protected] wrote:
<%=link_to_remote “A”, :url => attendee_path(:id => 1 , :event_id =>
event.id, :present => ‘1’) %> results in A. For some
reason amp; appears in the url.Someone knows why this happenes?
Missing route?
–
Greg D.
http://destiney.com/
it’s not a rotring problem. The route is generated as it should be. It
just injects amps; in the url.
I actually guess this is a bug but someone must have seen this before,
no?
Stijn
On Nov 22, 2:59 pm, Tarscher [email protected] wrote:
<%=link_to_remote “A”, :url => attendee_path(:id => 1 , :event_id =>
event.id, :present => ‘1’) %> results in A. For some
reason amp; appears in the url.Someone knows why this happenes?
It’s not a bug. This is how you’re supposed to encode ampersands in
HTML. Even in URLs which are part of tag attributes.
Chris
The thing is that I don’t want to encode ampersands and have no idea
where they come from. i only insert ids in the url andit seems that
rails adds amp; to them.
Stijn
Well just send is as a query string…no need to use url tag…if u dont
want to use amp just directly pass it as a query string and it will work
strange things happen
i tried to reproduce it, but it was not possible. if it would be a bug,
you would be right and this would have been seen by a lot of people
before.
the routes must exist, otherwise the path helper would have produced an
error.
but my guess would be the routing, too.
maybe you are using nested routes and have some typing error there?
could you post the routes?
Tarscher wrote:
The thing is that I don’t want to encode ampersands and have no idea
where they come from. i only insert ids in the url andit seems that
rails adds amp; to them.Stijn
You have to encode ampersands in order to be XHTML-compliant. Encoded
ampersands in a query string in a URL are parsed just the same. If
you’re working in, say, HTML 4 and you really don’t want the encoded
ampersands, then do a search for the method that encodes them and
override it. It’s a sensible default for Rails to do this.
Many thanks for all the replies. Still got some questions though
When I examine (with a debugger) the ‘present’ parameter that get send
via the ‘ampersanded’ url I see it calls them ‘amp;present’ and not
‘present’ as I want it to be called (and as defined in the model). Is
there a way I can remove this amp; drom ‘present’.
About XHTML compliant:
When I do a querry with Google
http://www.google.com/search?q=test&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_nlBE238BE238
I dont’ see the amp; s in the url. Isn’t Google XHTML compliant or am
I missing the point completeley
Stijn
On 22 nov, 17:29, Douglas Greenshields <rails-mailing-l…@andreas-
Many thanks for all the replies. Still got some questions though
When I examine (with a debugger) the ‘present’ parameter that get send
via the ‘ampersanded’ url I see it calls them ‘amp;present’ and not
‘present’ as I want it to be called (and as defined in the model). Is
there a way I can remove this amp; drom ‘present’.
About XHTML compliant:
When I do a querry with Google
test - Google Search…
I dont’ see the amp; s in the url. Isn’t Google XHTML compliant or am
I missing the point completely
Stijn
On 22 nov, 17:29, Douglas Greenshields <rails-mailing-l…@andreas-
On Nov 23, 2007 9:57 AM, Tarscher [email protected] wrote:
About XHTML compliant:
When I do a querry with Google
test - Google Search…
I dont’ see the amp; s in the url. Isn’t Google XHTML compliant or am
I missing the point completely
No, google’s pages aren’t valid XHTML, or even valid HTML 4.01. Google
doesn’t specify a doctype in their results pages, but when I tried
validating a results page against HTML 4.01 I got around 240 errors.
Ampersands are used in XHTML to indicate an entity that needs to be
translated, so they can’t be used on their own. That applies just as
much in entities (hrefs for links, image srcs, etc) as it does in
text. They have to be escaped to be &
There’s a lot of discussion of that online. Two I found quickly are:
http://www.mezzoblue.com/archives/2003/02/17/urls_vs_xhtm/
http://annevankesteren.nl/2004/06/ampersands-matter
James.
–
James S. - Web D.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs