This post is split into two parts. First we’re going to talk about how Ruby finds other files. Then, once we’ve got our head around that, we’re going to look at the extra sprinkles of magic that Rails adds on top.
(If you’re something of a Ruby magician already, and you’re just looking for the Rails bits, you can skip straight ahead to Part 2 – Loading Files in Rails)
Have you ever wondered: “How does Rails knows about all the classes in my app?”
Look at the code below:
# app/controllers/invoice_controller.rb
class InvoiceController < A