views:

40

answers:

1

I would like to be able to read Rails source code, but I think I can't really do it, because I don't know were to start and how different parts of the code are connected. For example, it's obvious what ActiveModel does and I can read the code, but I don't understand how a Rails app generally gets loaded and when exactly ActiveModel comes to play and which part of rails invokes it.

I'm not talking about this general stuff people say in manuals that first Rack gets loaded, then Rails is a rack app... No. I want something more detailed, so that I could actually look up every step in the code. So I guess some sort of chart explaining how rails app gets loaded and maybe a note to each of the subdir, saying where those files are used, what they do and where on the load chart they do load would be nice.

Any tips on that?

A: 

Rails follows a pretty traditional MVC (Model/View/Controller) design, which you can read up on.

If you'd like to get a good overview of how a request is processed by rails, this looks like a decent place to start:

http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/

Here's a more detailed article about how the Rails initializers and environment are loaded:

http://toolmantim.com/thoughts/environments_and_the_rails_initialisation_process

Winfield
I think I wasn't clear enough on that, sorry. I use Rails for over 2 years now, for sure I know what MVC pattern is, that's not the problem (the link you provided describes nothing new to me). What I want is to learn more about Rails from a Rails core developer perspective.
snitko
Posted another link that seems more like what you were looking for.
Winfield