About this article
I often confuse "render method" with "redirect_to" when implementing a view, so post it as a memorandum!
[environment] ・ Ruby 2.6.5, Rails 6.0.0 ・ MacOS
● render method = A method that specifies the view file to call. Display the view as it is without a new request.
● redirect_to = Same behavior as when sending a new request. Routing → Controller → Show View Usage scene: Transfer unlogged-in users to the top page or login page
At the end
I'm a beginner, but I'm studying rails, and options, methods, syntax, etc.
I felt that many of them had a vague understanding of what was different and how to use them properly.
I will continue to post one post every day, no matter how trivial it may be, so please take a warm look.
Recommended Posts