Topic: Controller Code Tutorial
Hi. Most tutorials do a bang-up job teaching WHAT a controller is, and WHAT an action is in relation to the rest of a rails project. But I have yet to read a tutorial that does a good job explaining HOW the code in a controller actually works.
Specifically:
class UsersController < ApplicationController
def action
* THIS PART HERE! *
end Obviously, it is Ruby code. But learning the Ruby code is too much of a "bottom-up" approach to learning these things. It seems like there should be better "top-down" methods of learning about such code. So, here are some questions that, if answered by RoR geniuses, might help a great deal:
(1) What are the 10 most common code snippets you use in the controller (what do they do and how do they work)?
(2) How do you know which way data is flowing? (From the model to the view, from a form to a model, etc..)
(3) What are common misconceptions about code in controllers?
(4) What are the most common mistakes people make when writing code in controllers?
Thank You.
Last edited by Starflyer59 (2011-02-28 02:20:35)