In a RoR project, where does all the library files sit?
Where are all the files? I see (as expected) that my 开发者_开发问答controllers/models etc inherit from other classes, where can I see the actual code of those classes?
If you want to find those classes on your machine, you have to go to the directory where ruby is installed and look for the gems directory. On my machine that is:
/usr/local/rvm/rubies/ruby-1.9.2-p136/lib/ruby/gems/1.9/gems
I just made a screenshot so that you can see where is everything. You can see it here. As you know, Rails is made up of many components (Active Record, Active Support, Action Mailer, Active Resource etc.) and each component has its own directory.
The code is in the rails gem. All the code is available in the Rails repository. There is usually no need to dive into the code, though, and the Rails Guides & official API are almost always sufficient.
for reference, you might try the open_gem gem. This adds a gem subcommand 'open', which will open an installed gem's root in your editor of choice. I often use the following command to open gems in textmate on os x:
gem open some_obscure_gem -c mate
精彩评论