Match in rails routes.rb redirects too many times
I have a route that needs to match something like this
localhost: 3000 / site / admin
and redirect to
local: 3000 / EN / site / admin
here is the route line that should fit this | routes.rb
match '*path', to: redirect("/#{I18n.default_locale}/%{path}")
but instead of matching it and redirecting to localhost: 3000 / en / site / admin it redirects infite to this
http://localhost:3000/en/en/en/en/en/en/en/en/en/en/en/en/en/site/admin
(adds /en until browser complains about infite loop)
Any idea why this infinite loop is happening? Thanks to
EDIT
Link to my entire routes.rb file
+1
source to share