Forum: Ruby on Rails How to organize models into modules

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.
Josh (Guest)
on 2006-03-30 01:05
Being a bit of a neat freek, I would like to organize the models in my
Rails app into modules.  I have created the directory structure as

 |- module1
     |- mymodel.rb

And my model class code is:

module Module1
 class Mymodel
  ...some stuff

How do I include this model in my controllers without referencing it as
"Module1::Mymodel"?  Also, how do I reference it in other model classes
(e.g. in a belongs_to statement)?

This topic is locked and can not be replied to.