# Group Models Into Folders

**URL:** <https://www.ruby-forum.com/t/group-models-into-folders/117206>\
**Category:** Rails\
**Created:** [October 14, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/group-models-into-folders/117206 "2007-10-14T20:09:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakob\_bliz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e9c0ed/32.png) [@jakob\_bliz](https://www.ruby-forum.com/u/jakob_bliz)\
**Post date:** [October 14, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/group-models-into-folders/117206/1 "2007-10-14T20:09:39Z")

</div>

Hi!

I have a lot of models in my app/models directory…  
I thought that it would be nice to group them into sub folders…

like app/models/foo/_.rb  
and app/models/bar/_.rb

How to do this?  
When I just move them into folders, they will not be loaded…  
But when i execute Foo::Model in console, I will get an error  
but after that Model is loaded…  
So this must be possible anyhow, it actually nearly works.

I also tried to generate models like ./script/generate model Foo::Model  
or ./script/generate model Foo/Model  
This actually works, but I would like to use Model instead of  
Foo::Model… so this module/namscape stuff is not what I’m looking for.

Would be nice if you could help me

thanks 🙂

---

<div class="post-metadata">

**Author:** ![jakob\_bliz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e9c0ed/32.png) [@jakob\_bliz](https://www.ruby-forum.com/u/jakob_bliz)\
**Post date:** [October 14, 2007, 10:12pm UTC](https://www.ruby-forum.com/t/group-models-into-folders/117206/2 "2007-10-14T22:12:33Z")

</div>

> **[Simpler irb — err.the\_blog](http://errtheblog.com/post/5)**
>
> Err the Blog: Ruby and Rails from the front.

On Oct 14, 2:09 pm, Jakob B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jakob\_bliz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e9c0ed/32.png) [@jakob\_bliz](https://www.ruby-forum.com/u/jakob_bliz)\
**Post date:** [October 14, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/group-models-into-folders/117206/3 "2007-10-14T22:28:09Z")

</div>

Jeff,

Thank you VERY much
