On Thu, Mar 27, 2008 at 1:14 PM, OmenKing <omen.king@gmail.com>
wrote:>
> I''m browsing the source of a version of rails I checked out
today.
>
> I want to understand how a Controller called ProjectsController knows
> that it should look for a model call Project and does whatever it has
> to do to say their married.
>
> Would anyone be able to give me an idea where I should be looking?
> I''m browsing in the ActionPack, but I could be way off here.
Controller''s don''t look anywhere but the ruby load path for
models.
By default, Rails adds app/models, app/controllers, lib, etc to the
load path. But, you won''t find any specific spot in the ActionPack
code where it "looks" for the model. It just expects the model
constant (Project in your example) to be available.
This isn''t the right forum for these questions. Please ask further
ones in the rubyonrails-talk forum. rubyonrails-core is for
discussion on future versions of Rails.
--
Rick Olson
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---