svenfuchs / routing-filter

routing-filter wraps around the complex beast that the Rails routing system is, allowing for unseen flexibility and power in Rails URL recognition and generation.
http://www.artweb-design.de
MIT License
464 stars 84 forks source link

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

Open edouard opened 1 year ago

edouard commented 1 year ago

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 commented 9 months ago

For the record - Here is the PR that broke compatibility: https://github.com/rails/rails/pull/49340

fwolfst commented 8 months ago

I think https://github.com/svenfuchs/routing-filter/pull/86 would fix this.

dbackeus commented 8 months ago

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 commented 8 months ago

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?).