MVC – Controller

The C in MVC stands for controller.

In previous weeks we have looked at both the Model and the View layers. We know that the model retrieves data out of the database and that the view displays that data. But how does the model know what data is required and how does the data get passed back to the view? That is where the controller comes in.

In the same way that every object in our application has a model and a number of views, each object also has a controller. The Controller is responsible for orchestrating the whole process of handling a request in Rails.

The routes.rb file maps an external request from a URL entered into a browser to an internal action within your Rails application. That internal action is a method in a controller. The controller may also contain logic to implement business rules.

348 thoughts on “MVC – Controller

  1. JimSteap says:

    Go to 1this website to see how to get diamonds on cooking fever

    The game is a whole lot more fun when you have as many diamonds as you want.If you love phone games like this you should check out this site

  2. TimSlelp says:

    Please post in this thread your sexiest petite chicks?Spanish cutie Eve Sweet is simply lovely, and he or she knows it. <a href=>Nova Adult Pics</a> Let her provide help to seduce her and get her moaning.

Leave a Reply

Your email address will not be published. Required fields are marked *