Forum: Ruby on Rails how does it know?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
701d97a3352284cdf7c9160c7371f515?d=identicon&s=25 Jacob Ezzell (Guest)
on 2006-02-07 19:35
I'm a recent Ruby/rails initiate, coming from PHP.  I'm working my way
through the Agile web development book, (slowly) and I ran into a wierd
bug where the method cart.empty! wasn't being found when I tried to call
it after loading my cart from the session hash.  Then I left it alone
for a while and now it works.  ACK! :)

My question is, how does ruby/rails know what files to include so it can
find the class I'm instantiating?  I'm used to having to include all my
files manually with php.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Jules Jacobs (Guest)
on 2006-02-07 19:44
(Received via mailing list)
If you put your files in the app/models directory, it will be
auto-loaded, IF you give the file the same name as the class.

4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-07 20:41
(Received via mailing list)
Take a look at the stuff rails generates for you in the config
directory... boot.rb, environment.rb, etc.

This topic is locked and can not be replied to.