How does Ruby on Rails use the Model View Controller (MVC) framework?

Technology CommunityCategory: Ruby on RailsHow does Ruby on Rails use the Model View Controller (MVC) framework?
VietMX Staff asked 3 years ago

Web development can often be divided into three separate but closely integrated subsystems:

  • Model (Active Record): The model handles all the data logic of the application. In Rails, this is handled by the Active Record library, which forms the bridge between the Ruby program code and the relational database.
  • View (Action View): The view is the part of the application that the end user sees. In Rails, this is implemented by the Action View library, which is based on Embedded Ruby (ERB) and determines how data will be presented.
  • Controller (Action Controller): The controller is like the data broker of an application, handling the logic that allows the model and view to communicate with one another. This is called the Action Controller in Rails.