Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove side effects on :controller option in #url_for #6375

Closed
wants to merge 1 commit into from

Conversation

senny
Copy link
Member

@senny senny commented May 18, 2012

Bug Description:

If the :controller option in an url_for call contains a leading slash it
will be removed, which causes side-effects:

my_controller = '/Example'
url_for(:controller => my_controller)
puts my_controller # => 'Example'

The side-effects then affect plugins like will_paginate, which store the options to pass to url_for in an instance_variable. The functionality then breaks after the first call to url_for.

Resolution:

The route-set does not directly manipulate the string passed into #url_for.
It creates a copy without the leading slash if necessary.

Bug Description:

If the :controller option in an url_for call contains a leading slash it
will be removed, which causes side-effects:

my_controller = '/Example'
url_for(:controller => my_controller)
puts my_controller # => 'Example'

Resolution:

The route-set does not directly manipulate the string passed into #url_for.
It creates a copy without the leading slash if necessary.
@arunagw
Copy link
Member

arunagw commented May 18, 2012

your PR needs a rebase. Not sure why it's showing that it cannot merge automatically.

@josevalim
Copy link
Contributor

👍 please rebase, ping us, and we will merge it straight away!

@senny
Copy link
Member Author

senny commented May 18, 2012

sorry for bothering with the outdated patch. I updated the source and noticed, that the bug was already fixed in a different commit: beea9f5

@senny senny closed this May 18, 2012
@clee704
Copy link

clee704 commented Dec 1, 2012

This is not fixed in 3.2.9, though I can find the changed code in master and 3.2-stable branches. When will it be available? Sorry if I'm asking a wrong question I'm new to how Rails is released.

@carlosantoniodasilva
Copy link
Member

@clee704 there's no specific release date for a new 3.2.x version yet. If you need that feature, I'd recommend bundling from github using 3-2-stable branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants