Forum: Ruby on Rails Newbie question: How to reference models in subdirectories

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Juergen Barth (Guest)
on 2006-04-01 17:43
Hi, new to RoR I am probably going to embarrass myself now:


I have models organised in subdirectories, i.e.

models
  |--material
        |--product.rb
  |--cross-applications
        |--currency.rb


When I try to reference another model within the same subdirectory,
everything works fine, i.e.

belongs_to :product_categories, :class_name =>
'Material::ProductCategory"

However, when I reference a model in a different subdirectory, I get an
uninitialized constant error, i.e.

belongs_to :currencies, :class_name => 'CrossApplications::Currency'
=>
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:112:in
`const_missing': uninitialized constant 'CrossApplications'

What am I doing wrong here?
Thanks in advance for patience and a helpful answer!
Juergen
This topic is locked and can not be replied to.