I know about redirecting a specific route:
put 'users/:user_id', to: redirect('/api/v1/users/:user_id')
How would I apply the redirect to all routes generated by resources
? Looking for something like
resources :users, to: redirect('/api/v1')
I can achieve a workaround using match, but it's a bit clunky:
match 'users/*path', to: redirect('/api/v1/users/%{path}'), via: [:GET, :POST, :PUT, :DELETE]