jasonbogd
jasonbogd

Reputation: 2491

Understanding Rails core source code?

I would like to start making code patches to Rails. Are there any good books on 'advanced' Ruby that I should read to understand the rails source code? Are there any other tips on getting started? Rails seems like a large beast and I don't know where to start!

Thanks, Jason.

UPDATE: I'm also looking for something that explains more the 'networking' side of it -- i.e. HTTP, web servers, Rack, etc.

Upvotes: 9

Views: 1799

Answers (7)

Lane
Lane

Reputation: 4986

Jasonbogd.

I spent 3 weeks to dig into Rails5's source code in 2019.

After I did that job, I became confident in explaining Rails.

Hope my work can help you too.

Here is my post: https://github.com/gazeldx/Learn-Rails-by-Reading-Source-Code

Table of Contents
Part 0: Before reading Rails 5 source code
  What will you learn from this tutorial?
Part 1: Your app: an instance of YourProject::Application
Part 2: config
Part 3: Every request and response
  Puma
  Rack apps
  The core app: ActionDispatch::Routing::RouteSet instance
  Render view
  How can instance variables defined in Controller be accessed in view file?
Part 4: What does $ rails server do?
  Thor
  Rails::Server#start
  Starting Puma
  Conclusion
  Exiting Puma
  Process and Thread
  Send SIGTERM to Puma

Upvotes: 0

benm
benm

Reputation: 96

Medium eXposure's Rails 3 Reading Material has a ton of ... er, reading material, and Jason Seifer's 32 Rack Resources to Get You Started should keep you occupied on Rack for as long as you want.

You might be interested in Rails on Rack. It assumes some knowledge of Rack but provides good links for obtaining that knowledge.

The Engine Yard series on the Rails and Merb merge contains a lot of good information about the inner workings and upcoming changes in Rails 3.

Upvotes: 1

poseid
poseid

Reputation: 7156

maybe the book ruby-for-rails from David Black at Manning could help you as well

Upvotes: 2

baol
baol

Reputation: 4358

As you have noted you should probably start with the basics. I'd suggest reading "Computer Networks" by Andrew S. Tanenbaum while learning rails and ruby. You can find it in almost any scientific library.

Upvotes: 0

stephenmurdoch
stephenmurdoch

Reputation: 34603

you need "the rails way" by obie fernandez - http://my.safaribooksonline.com/9780321445612

it's far better than any other rails books - just pure information - doubt that it's rails3 ready but there might be plans for an updated version - seriously, buy it

Upvotes: 1

Ryan Bigg
Ryan Bigg

Reputation: 107718

I've written the beginnings of an initialization guide for Rails 3 that may help you understand some of the common concepts in Rails 3. This covers mostly the "railties" part, but branches out in the actual Railties. It really depends on what you want to patch/look at in Rails as to how much this actually applies to you.

Upvotes: 12

Michael Sondergaard
Michael Sondergaard

Reputation: 1494

My advice would be to read this one: http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition to get a pretty much complete understanding of how rails works on the outside, if you haven't already.

And then checkout the latest trunk and start reading a component you like, messing with files as you please and trying out the changes on a live project.

Metaprogramming is a concept used a lot in Rails, so this book would definitely be good too: http://pragprog.com/titles/ppmetr/metaprogramming-ruby.

Hope that'll put you on your way

Upvotes: 7

Related Questions