This project is archived and is in readonly mode.
link_to generates incorrect hrefs
-
Jeremy Kemper
- State changed from new to open
- Assigned user set to Carl Lerche
-
Denis Odorcic
- Tag set to default_url_options, patch, script_name, url_for
So I looked into this issue and it seems that script_name was introduced to url_for's url_options. It then gets prepended to the path that url_for generates, however it should only be prepending it when the user passes it in as far as I can tell. In this example, say/hello is the script name that the controller picks up and ends up prepending it to say/goodbye.
I've attached a patch, a couple of tests for the above cases I described, and also a 3rd fix on an existing test that failed after I made this fix. I took a close look at the test and as far as I can tell there's no reason that its url should have 'bar' in it, but if someone could double check that would be great.
-
Denis Odorcic
Deleted the fix of an existing test as it was reverted a few minutes ago by b9c48f519
-
Denis Odorcic
- Tag changed from default_url_options, patch, script_name, url_for to default_url_options, script_name, url_for
Spoke too soon, not all tests were passing, at least you guys are pointed in the right direction :) I think the failing tests I added should be correct though, so I'll leave that up here.
-
José Valim
Sam, this seems to be fixed on master. Could you please check?
-
Denis Odorcic
Looks like it has been fixed in master now, yes.
-
José Valim
- State changed from open to resolved
