MVC

MVC stands for Model-View-Controller, and is a way of laying out web apps to separate different functions and keep the code clean.

Model
The model is the part that represents the data used by the application, and presents it in an OO form that's readily used by the rest of the code. This is typically done through some kind of Object-Relational Mapping (ORM) that maps the tables ("relations") in a relational database with objects in your app. In Rails, the ORM is called ActiveRecord.

There are models for each type of object in the application, eg. Crop, Member, Garden.

View
This is the front-end of the app, the bits of it that your end-user sees. In a web app, that usually means HTML webpages. In Rails, the HTML is created by a templating language called ERB or, if you prefer, by an alternate templating language like HAML. (Growstuff uses HAML.)

Rails typically generates views for each model (eg. /views/crops for displaying and editing Crop objects) but there are also views for static pages, etc. (eg. /views/policy where the Terms of Service and other policy documents are displayed.)

Controller
The controller is the glue that holds the app together. It responds to events (in a web app, those would be HTTP requests), figures out what data it needs, gets it from the Model, and then passes it through to an appropriate View for display.

Rails typically generates a controller for each model, for instance controllers/crops_controller.rb in relation to the Crop model.

Rails controllers typically have a method to handle the various HTTP requests to create, read, update, and delete objects via the app. (The acronym for these actions is "CRUD".)

In Growstuff's code
For more information, see: Code tour