Skip to content

Fix setting trailing_slash: true in route definition #44434

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

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

casperisfine
Copy link
Contributor

Ref: #43287
Fix: #44373

The OptimizedUrlHelper wasn't considering this option.

Ref: rails#43287
Fix: rails#44373

The `OptimizedUrlHelper` wasn't considering this option.
@rails-bot rails-bot bot added the actionpack label Feb 15, 2022
@@ -196,7 +196,9 @@ def initialize(route, options, route_name)
def call(t, method_name, args, inner_options, url_strategy)
if args.size == arg_size && !inner_options && optimize_routes_generation?(t)
options = t.url_options.merge @options
options[:path] = optimized_helper(args)
path = optimized_helper(args)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless I missed something, we know for sure that path doesn't contain a format at this point.

@casperisfine
Copy link
Contributor Author

This will be backported to 7-0-stable.

cc @WaKeMaTTa, @nvasilevski, @ghiculescu (thanks for the ping, I totally didn't see the issue).

@byroot
Copy link
Member

byroot commented Feb 15, 2022

Some unrelated Active Support tests flaked, I'll have to look into them.

@byroot byroot merged commit efd066c into rails:main Feb 15, 2022
@byroot
Copy link
Member

byroot commented Feb 15, 2022

Backported in 7-0-stable as 3b59b09

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.

with_options trailing_slash: true is broken on Rails 7
2 participants