Let's summarize "MVC" of Ruby on Rails

At first

** Day 14 of Calendar Planning 2020 ** It's been about 3 months since I started studying programming, so I will leave a note of what I learned in the article as an output. I would be happy if I could help anyone entering the world of programming. Please let me know if there are any words that are wrong, wrong, or misunderstood ^^ I'm sorry if it's hard to read the words for a long time. I will do my best to get used to it little by little.

Let's summarize "MVC" of Ruby on Rails

Ruby on Rails is based on the idea of ​​MVC. M: Model V: View C: Controller

It makes it easier to maintain the program by dividing the roles into each, and it is less likely to affect when working with multiple people.

Model

Where to handle application data. It plays a role in processing such as registering, acquiring, updating, and deleting data in the database.

For example I think it's an image of managing a huge warehouse called a database. It feels like it retrieves and stores the information you need when you need it.

View

This is the part related to the screen of the personal computer. This is what the user sees. A place to assemble HTML to be displayed in the browser.

For example Is it the image of a deliveryman? Feeling of delivering what you ordered to the customer We will not deliver what the customer does not ask for

Controller

A place where Model and View are controlled in an integrated manner. When the user clicks the page he wants to see, the Controller first receives it, works with the Model to pull out the necessary information from the database, and controls the flow of displaying it using the View.

For example Image like a command tower Feeling like receiving an order from a customer and instructing the huge warehouse to work smoothly, or instructing a delivery person to deliver other ordered items from the warehouse to the appropriate place next time

Finally

I intended to explain while conveying the image, but it was difficult ^^; One thing I can say is that the role is clear, so it's good that it doesn't get complicated. What's not working when I'm writing an application and stumbling? Where is it stuck? It's easy to discover if you understand this structure!

Click here for some of the sites that are illustrated Reference site 1 Reference site 2

Recommended Posts

Let's summarize "MVC" of Ruby on Rails
Ruby on Rails ~ Basics of MVC and Router ~
Basic knowledge of Ruby on Rails
[Ruby on Rails] Introduction of initial data
[Rails] Addition of Ruby On Rails comment function
part of the syntax of ruby ​​on rails
[Ruby on Rails] Japanese notation of errors
Explanation of Ruby on rails for beginners ①
[Ruby on rails] Implementation of like function
Ruby on Rails Elementary
Ruby on Rails basics
Ruby On Rails Association
Implementation of Ruby on Rails login function (Session)
[Ruby on Rails] Until the introduction of RSpec
Recommendation of Service class in Ruby on Rails
[Ruby on Rails] A memorandum of layout templates
[Ruby on Rails] Let's build an environment on mac
[Ruby on Rails] Individual display of error messages
Ruby on Rails <2021> Implementation of simple login function (form_with)
[Ruby on Rails] Asynchronous communication of posting function, ajax
Ruby on rails learning record -2020.10.03
Portfolio creation Ruby on Rails
Implementation of Ruby on Rails login function (devise edition)
Ruby on rails learning record -2020.10.04
[Ruby on Rails] Debug (binding.pry)
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Ruby on Rails config configuration
Ruby on Rails basic learning ①
[Ruby on Rails] about has_secure_password
[Ruby on Rails] Implementation of tagging function/tag filtering function
Ruby on rails learning record-2020.10.07 ②
Commentary on partial! --Ruby on Rails
Ruby on rails learning record-2020.10.07 ①
Cancel Ruby on Rails migration
Ruby on Rails Refactoring method example summary around MVC
Ruby on rails learning record -2020.10.06
Explanation of Ruby on rails for beginners ⑥ ~ Creation of validation ~
Explanation of Ruby on rails for beginners ② ~ Creating links ~
Ruby on Rails validation summary
Ruby on Rails Basic Memorandum
Try using the query attribute of Ruby on Rails
Explanation of Ruby on rails for beginners ⑦ ~ Flash implementation ~
Ruby on Rails for beginners! !! Summary of new posting functions
[Procedure 1 for beginners] Ruby on Rails: Construction of development environment
[Ruby on Rails] Elimination of Fat Controller-First, logic to model-
(Ruby on Rails6) Display of the database that got the id of the database
Delete all the contents of the list page [Ruby on Rails]
A note about the seed function of Ruby on Rails
[Ruby on Rails] Easy scroll animation of javascript (using ScrollReveal.js)
Let's summarize how to extend the expiration date of Rails
Explanation of Ruby on rails for beginners ③ ~ Creating a database ~
[Ruby on Rails] Read try (: [],: key)
[Ruby on Rails] yarn install --check-files
Ruby on Rails variable, constant summary
Installing Ruby + Rails on Ubuntu 18.04 (rbenv)
Progate Ruby on Rails5 Looking Back
How to use Ruby on Rails
[Ruby on Rails] Add / Remove Columns
Ruby on Rails Japanese-English support i18n
(Ruby on Rails6) "Erase" posted content