[RUBY] Difference between render method and redirect_to


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

Difference between render method and redirect_to
Difference between redirect_to and render
Difference between redirect_to and render
Difference between render and redirect_to
Difference between render and redirect_to
Difference between render and redirect_to
[rails] Difference between redirect_to and render
[Rails] Difference between redirect_to and render [Beginner]
Difference between render and redirect_to, need for arguments
Difference between instance method and class method
Difference between == operator and equals method
Difference between == operator and eqals method
[Rails] I investigated the difference between redirect_to and render.
Difference between vh and%
Difference between i ++ and ++ i
[Rails] Difference between create method and new + save method
Difference between product and variant
[Java] Difference between == and equals
Rails: Difference between resources and resources
Difference between puts and print
Rails "render method" and "redirect method"
Difference between CUI and GUI
Difference between variables and instance variables
Difference between mockito-core and mockito-all
Difference between class and instance
Difference between bundle and bundle install
Difference between ArrayList and LinkedList
Difference between List and ArrayList
Difference between .bashrc and .bash_profile
Difference between StringBuilder and StringBuffer
[Rails] Display error message-Differences between render and redirect_to, flash-
Ethereum Transaction Sending Method Difference between send and sendAsync
[Rails] What is the difference between redirect and render?
[Ruby] Difference between get and post
Difference between interface and abstract class
[Java] Difference between Hashmap and HashTable
[Terminal] Difference between irb and pry
JavaServlet: Difference between executeQuery and executeUpdate
[Ruby] Difference between is_a? And instance_of?
Rough difference between RSpec and minitest
[Rails] Difference between find and find_by
Proper use of redirect_to and render
Understand the difference between each_with_index and each.with_index
Difference between instance variable and class variable
[Rails] Differences between redirect_to and render methods and how to output render methods
[JAVA] Difference between abstract and interface
Difference between Thymeleaf @RestController and @Controller
Difference between Stream map and flatMap
[Java] Difference between array and ArrayList
What is the difference between an action and an instance method?
Difference between primitive type and reference type
Difference between string.getByte () and Hex.decodeHex (string.toCharaArray ())
[Java] Difference between Closeable and AutoCloseable
Let's override the difference between == (identity) and equals method (equivalence)
[Java] Difference between StringBuffer and StringBuilder
[Java] Difference between length, length () and size ()
[Android] Difference between finish (); and return;
Easy to understand the difference between Ruby instance method and class method.
Note: Difference between Ruby "p" and "puts"
Difference between final and Immutable in Java
[Memo] Difference between bundle install and update