Reputation: 12066
How can you redirect using a 302 from within the routes.rb file?
Upvotes: 44
Views: 15234
Reputation: 12066
You can pass in the status to the redirect in the route statement. For example, to do a 302 redirect:
In the routes.rb
get '/old/path', to: redirect('/new/path', status: 302)
I hope this helps someone else!
Upvotes: 88