- See more at: http://blogtimenow.com/blogging/automatically-redirect-blogger-blog-another-blog-website/#sthash.YsVbCxL0.dpuf Journey to Becoming a Web Developer: MVC

Monday, January 6, 2014

MVC















I found this picture online which I felt was the clearest visual representation that I've seen of the MVC principle. Today at the Flatiron School we learned Rails which uses the MVC principle. I like to use CVM because it helps me to remember the order it actually flows in. Here I will go through what the Model, View, and Controller do in Rails.

Controller - has the actions that give orders to the Model
Model - when a migration is created the model talks to the database and retrieves the information that controller is asking for. The model inherits from ActiveRecord.
View - after model retrieves data from the database it sends the information to the controller. The controller then calls the view. The view displays the logic from the model in the form of HTML in the browser.

No comments:

Post a Comment