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

URLs in the sitemap don't respect default_url_options. #355

Open
tosbourn opened this issue Jun 29, 2020 · 2 comments
Open

URLs in the sitemap don't respect default_url_options. #355

tosbourn opened this issue Jun 29, 2020 · 2 comments

Comments

@tosbourn
Copy link

With a Rails project setup with the following line in config/application.rb

config.action_controller.default_url_options = { trailing_slash: true }

You would expect foos_path to generate /foos/

When referencing foos_path from config/sitemap.rb the path that is generated is the default Rails one, /foos (without the trailing slash).

The workaround is to call foos_path(trailing_slash: true), but it would be nice if the sitemap respected the options laid out in for default_url_options, even though these are bundled in action_controller.

@dtbaker
Copy link

dtbaker commented Feb 10, 2021

@tosbourn did you figure out a way to do this globally? I just ran into the same issue. Thanks for the trailing_slash: true hunt, I'll do that until I can find a way to do it globally

@tosbourn
Copy link
Author

@dtbaker nope, I've just been adding trailing_slash: true, now the code has a president for it, there isn't a big cognitive burden to doing it on new additions to the file.

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

No branches or pull requests

2 participants