ruby on rails - how to redirect_to and return a 200 status code -


i have rails app pings stripe new credit card when user fills out form. redirects homepage when its' done. however, stripe says i'm returning 503 (i think that's code) instead of 200. i'm doing regular redirect_to :root. how make sure return 200 code?

i'm afraid can't.

the rails method

redirect_to some_path 

works sending browser http response 302 status code , url destination (as http response header).
once browser receives response, automatically fire new http request new url.

the redirection does not happen in rails. lot of people think redirect_to way jump controller's action another, asks browser send request.

now, browsers know how handle kind of response because 302 http status code. that's meaning. can change status code of redirect_to 200, break redirection.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -