Relationship between Controller and View

Relationship between Controller and View

Create a file in the app / views directory to generate the views returned to the browser. Specifically, create a directory with the same controller name in this directory, and place the view file under it. This allows you to associate a controller with a view file, and the associated view file is combined with a "layout" or "partial template" and displayed in the browser.

ccbf8eabf3c997adf4fc0c803b03adee.png

@Tweets acquired by the controller is read through multiple methods defined behind Ruby on Rails and passed to Action View. And it is set as an instance variable of the view file again, and it can be used for the first time.

dd01d250aba4f2082707dcdf4082246e.png

In order to understand the process that realizes "a mechanism that can be used as it is in a view file if you define an instance variable", you need to read the source code that builds Ruby on Rails.

Recommended Posts

Relationship between Controller and View
Relationship between package and class
Rails routing controller view relationship
Relationship between ActiveRecord with_lock and cache
Relationship between database and model (basic)
[Java] Relationship between H2DB and JDBC
Difference between Thymeleaf @RestController and @Controller
Relationship between kotlin and java access modifiers
Relationship between Eclipse m2e plugin and Maven
Relationship between UI test and recording, implementation method
Switch between JDK 7 and JDK 8
Difference between vh and%
Difference between i ++ and ++ i
Difference between new and create in Rais action controller
About the relationship between HTTP methods, actions and CRUD
Verification of the relationship between Docker images and containers
[Rails] How to edit and customize devise view and controller
Difference between product and variant
Difference between redirect_to and render
[Java] Difference between == and equals
Rails: Difference between resources and resources
Difference between puts and print
Difference between redirect_to and render
Difference between CUI and GUI
Spring Model View Controller Flow
Difference between variables and instance variables
Difference between mockito-core and mockito-all
Difference between class and instance
Difference between bundle and bundle install
Connection between ViewModel and XML
Difference between ArrayList and LinkedList
Difference between render and redirect_to
Difference between List and ArrayList
Differences between IndexOutOfBoundsException and ArrayIndexOutOfBoundsException
Difference between .bashrc and .bash_profile
Difference between StringBuilder and StringBuffer
Difference between render and redirect_to
Difference between render and redirect_to
[Ruby] Relationship between parent class and child class. The relationship between a class and an instance.
[Java] Introductory structure Class definition Relationship between class and instance Method definition format
The relationship between strict Java date checking and daylight savings time
About the relationship between the Java String equality operator (==) and initialization. Beginners
[Ruby] Difference between get and post
Difference between instance method and class method
Difference between render method and redirect_to
Difference between interface and abstract class
Difference between == operator and equals method
Relationship between Homebrew + rbenv + ruby-build (Part 1)
Mutual conversion between Function and Consumer
Differences between "beginner" Java and Kotlin
[Terminal] Difference between irb and pry
JavaServlet: Difference between executeQuery and executeUpdate
Difference between == operator and eqals method
Rough difference between RSpec and minitest
[Rails] Difference between find and find_by
Understand the difference between each_with_index and each.with_index
Difference between instance variable and class variable
[JAVA] Difference between abstract and interface
Difference between Stream map and flatMap
Differences between Applet class and JApplet class
[Java] Difference between array and ArrayList