# How to organize models into modules

**URL:** <https://www.ruby-forum.com/t/how-to-organize-models-into-modules/56269>\
**Category:** Rails\
**Created:** [March 29, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/how-to-organize-models-into-modules/56269 "2006-03-29T23:05:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [March 29, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/how-to-organize-models-into-modules/56269/1 "2006-03-29T23:05:26Z")

</div>

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  
follows:

models  
|- module1  
|- mymodel.rb

And my model class code is:

module Module1  
class Mymodel  
…some stuff  
end  
end

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)?

Thanks!
