Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding a slide about controllers.

  • Loading branch information...
commit 5f8d24b9a2ac5bec126cb3ab8afe53cfe56e5557 1 parent 3bd4a4f
@aeschright aeschright authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 rubything.textile
View
9 rubything.textile
@@ -544,6 +544,15 @@ These also work through has_many associations, so given a particular user record
% and a message that says "Congrats, <name>, you're the angriest person here!"
% AE note - this might be a good one for people moving fast, but the way I would probably recommend doing it is involved enough I'd keep this as a bonus exercise only %
+h1. What about the C in MVC?
+
+Now that we've seen and edited models and views, let's take a quick look at the controller files in our project.
+
+What does a controller do?
+* It connects the view and the model, calling methods on the models to get the data needed for the view.
+* It responds to the HTTP request from the browser, and renders the requested type of output (in our scaffolds, this is html or xml, but other things like json can easily be added--instant API!)
+* The controller is also where you would add access control, like only allowing the user who wrote the rant to delete it.
+
h1. Making Your Own
* Exit @microrant@ directory
Please sign in to comment.
Something went wrong with that request. Please try again.