Hello and welcome.
In this lecture harbi Explaining what m c means what is MVC NBC basically stands for Mondo new controller.
It's a principle or type of architecture that devised the work of an application into three separate
but closely corporative subunits.
So we've got the model view and the controller.
Let's take a brief look at each of them.
We start with the model the model basically contains the data for the application.
So it's often linked to a database or behind the model.
Always be a database that stores the data.
The model contains all of things like the business all the business logic for the application is stored
in the model and in Ruby on Rails application the model is actually the thing that looks after the work
of the model is known as the active record.
So the active record does the work of the model in a Ruby on Rails application.
So it is the layer of the system responsible for representing the business data and the logic.
So the active record will facilitate things like the creation and the use of business objects whose
data requires persistence storage to a database so a model will always have a database to handle this
storage.
Next a look at The View review basically is used to present the data to the user.
So the main purpose of the view in this architecture is to generate user interface and present the data
to the user.
So it's kind of like a passive for all that doesn't really do any processing behind the scene.
All it does is present the data has a view to the user I mean we have the controller.
So the controller basically in Ruby on Rails is the logical centre of the application.
So it coordinates the interaction between the user view and the module.
So when a request comes in for a website say for example someone typed in WWE Dort Instagram dot com.
It is the controller that is responsible responsible for making sense of the request.
Produce him the appropriate answer put to let's have a look at this a shot of how this would work.
So we have somebody on the computer and they type in to their Web browser say wwor instagram dot com.
What then happens that request gets passed to.
He rails router Ruby on Rails.
The rails are attached is kind of like a dispatcher.
So when the request condee it looks like you are real and dispatches you are real to a controller the
control and then takes a look and passes the request to the model.
The model then queries the database for the information the database looks for the information passes
it back to the model the model then passes the information back to the controller.
The controller then passes the information to the view and the view then displays the data which is
for example if the destination was Instagram.
So that's how basically the MVC architecture works which is the architecture that rails employees.
So it's good to have an understanding of how the model did view and controller works.
So when you start working with it it gives you an idea of what's going on behind the scenes.
So that's it for this brief introduction to MVC architecture.
Thanks for watching.
Bye for now.