Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

rails should use & instead of & in the urls

#2076

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)

Reported by xdmx · February 25th, 2009 @ 11:38 PM

State: committed
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Phil Darnowsky
    Phil Darnowsky
    • 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.

    October 6th, 2009 @ 10:58 PM

  2. Phil Darnowsky
    Phil Darnowsky
    • 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.

    October 7th, 2009 @ 08:06 PM

  3. Michael Koziarski
    Michael Koziarski
    • 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

    October 14th, 2009 @ 10:03 PM