unwanted amp injected in url

Hi all,

<%=link_to_remote "A", :url => attendee_path(:id => 1 , :event_id =>
event.id, :present => '1') %> results in <a href="#" onclick="new
{asynchronous:true, evalScripts:true}); return false;">A</a>. For some
reason amp; appears in the url.

Someone knows why this happenes?

Thanks in advance

Missing route?

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,


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.


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.


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
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 &amp;

There's a lot of discussion of that online. Two I found quickly are: