Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 routes.rb 文件中使用 302 进行重定向?
您可以在路由语句中将状态传递给重定向。例如,要执行 302 重定向:
在里面routes.rb
routes.rb
get '/old/path', to: redirect('/new/path', status: 302)
我希望这对其他人有帮助!