[Ruby] [rails] The difference between redirect_to and render

less than 1 minute read

Difference between #redirect_to and render In the beginning, I used it without understanding the difference. The processing flow was different.

For ##redirect_to

① controller (redirect_to) → ② HTTP request → ③ routing → ④ controller → ⑤ view

For ##render

① controller → ② view

In my sense, basically I don’t use render much except for partial templates.