I'm an experienced developer which quite some experience in meta programming. I just found my way to Ruby and want to understand more of Rails (and related) project internals. Even if I understand the high level concepts, it's hard to get an overview of those projects. I wonder how other people approach that problem? How would you for example approach the Mongoid source code to get a good understanding of it's internals?
closed as too broad by gnat, MichaelT, amon, jwenting, Bart van Ingen Schenau Sep 3 '14 at 13:12
There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.
I hate to recommend another book, but I think this one pretty much has what you are looking for. Personally, I like the structure and completeness that books provide when getting into something that I'm unfamiliar with (which, consequently, is a lot of stuff)
If you are new to Rails, the best thing you can do is start from the beginning. Learn the framework and code up a couple of projects. This will get you accustomed to the "Rails way" of doing things.
Once you are comfortable with Rails, you can start diving in deeper to really understand how things work behind the scenes.
I recommend this book to start out. It's a little on the basic end, but it does provide a good starting off point in my opinion.
When you study the Rails implementation, you can broadly "cut it up" into several big pieces, and work on them one by one. I would take them in this order:
Active Support and Active Record both "stand alone" and are not dependent on the rest of the framework, which makes them easier to decipher. That is why I recommend you start with those two. When studying Active Record, you will also want to look at the code for the ARel gem -- AR doesn't make much sense without it.
When you are ready to tackle Action Pack, you might want to start with the request router, which is also fairly "stand-alone".
When studying each part, read the RDocs first. Rails is well-documented, and before you dive into the code, that documentation will give you a good overview of what classes are there, and what each one is for. That will also help you choose a good place to start reading the code.