This project is archived and is in readonly mode.

#2076 ✓committed
xdmx

rails should use & instead of & in the urls

Reported by xdmx | February 25th, 2009 @ 11:38 PM | in 2.x

Hi, i've found this little annoiance which breaks the w3 validation/standard.

When you write an url like this: http://site.com/users/1?somethin... it should be written with & instead of &, so the correct version would be http://site.com/users/1?somethin...

I've found that rails work good with this, it use & and all it's right (using user_url(:something => 'x', :other => 'y')) but when you have a nested resources like http://site.com/users/1/posts?so... (user_posts_url(@userm :something => 'x', :other => 'y') it user & instead of &

Can anyone check if this happen in the edge version? (i'm using rails 2.2.2)

Comments and changes to this ticket

  • Phil Darnowsky

    Phil Darnowsky October 6th, 2009 @ 10:58 PM

    • Tag changed from amp, url, url_for, validation, w3c to action_view, amp, url, url_for, validation, w3c

    It's still in edge as of now, and only the ActionView version of #url_for has this bug, not ActionController. I've got a test that exposes it now, and will write a patch.

  • Phil Darnowsky

    Phil Darnowsky October 7th, 2009 @ 08:06 PM

    • Tag changed from action_view, amp, url, url_for, validation, w3c to action_view, amp, patch, url, url_for, validation, w3c

    Patch attached. I changed the default behavior here, not without some hesitation, but that behavior is both wrong and inconsistent with ActionController#url_for.

  • Michael Koziarski

    Michael Koziarski October 14th, 2009 @ 10:03 PM

    • State changed from “new” to “committed”

    I've applied this to master and also changed the html_safety so we know they'll get escaped as needed later on

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages