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

do not append a second slash when using trailing_slash: true #8701

Merged

Conversation

senny
Copy link
Member

@senny senny commented Jan 2, 2013

The source issue is #8700

# before
root_url # => http://test.host//

# after
root_url # => http://test.host/

I changed the code to only append a "/" when the current path does not already end with "/". I added the test-case to routing_test instead of url_for_test to make sure, the right arguments are passed to url_for and end up in the right url.

@senny
Copy link
Member Author

senny commented Jan 2, 2013

@acapilleri I kind of prefer the current version. I know it has a little duplication but I like how it reads.

Class.new do
def url_options
options = super
define_method :url_options do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to change it do define_method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise I can't pass additional_options through.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you are right

rafaelfranca added a commit that referenced this pull request Jan 2, 2013
…lash

do not append a second slash when using `trailing_slash: true`
@rafaelfranca rafaelfranca merged commit 8af6747 into rails:master Jan 2, 2013
senny added a commit to senny/rails that referenced this pull request Jan 2, 2013
rafaelfranca added a commit that referenced this pull request Jan 2, 2013
Backport #8701, do not append a second slash with `trailing_slash: true`

Closes #8700
@senny senny deleted the 8700_double_slash_with_trailing_slash branch January 2, 2013 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants