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

routing-filter doesn't seem to work with rails 7.1 #83

Open
edouard opened this issue Oct 26, 2023 · 4 comments
Open

routing-filter doesn't seem to work with rails 7.1 #83

edouard opened this issue Oct 26, 2023 · 4 comments

Comments

@edouard
Copy link

edouard commented Oct 26, 2023

It worked fine with rails 7.0 but not with 7.1. When using filter :locale in routes.rb, params[:locale] isn't set to anything

@dbackeus
Copy link

For the record - Here is the PR that broke compatibility: rails/rails#49340

@fwolfst
Copy link
Contributor

fwolfst commented Feb 22, 2024

I think #86 would fix this.

@dbackeus
Copy link

That PR does not fix the issue in our app. It appears to be a different error in that it avoids some exception. It does not fix the "silent failure" for mutating params.

@viktorianer
Copy link

Temporary fix is to use params: { locale: "en" } in button_to helper, see https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to.

I discovered this problem in a new app, but after fixing this, I still can not redirect to correct root path, because after redirect_back_or_to root_path(locale), I still have the old URL in my browser. Seams to be related to how Turbo 8 is now loading/reloading the pages. Anyway, need to figure out, what is wrong in my setup, as the approach described in https://edgeguides.rubyonrails.org/i18n.html#managing-the-locale-across-requests is not working for me (and probably for all new apps?).

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

4 participants