# How to use subdirs in the models directory

**URL:** <https://www.ruby-forum.com/t/how-to-use-subdirs-in-the-models-directory/119298>\
**Category:** Rails\
**Created:** [November 5, 2007, 10:11pm UTC](https://www.ruby-forum.com/t/how-to-use-subdirs-in-the-models-directory/119298 "2007-11-05T22:11:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [November 5, 2007, 10:11pm UTC](https://www.ruby-forum.com/t/how-to-use-subdirs-in-the-models-directory/119298/1 "2007-11-05T22:11:18Z")

</div>

I would like to sort some of my models better into different folders.  
Unfortunately when I do so it is unable to find the models.

I have updated the boot.rb file to:  
#Rails::Initializer.run(:set\_load\_path)  
Rails::Initializer.run do |config|  
config.frameworks -= [:action\_web\_service]

```
config.load_paths += %W[
  #{RAILS_ROOT}/app/models/
  #{RAILS_ROOT}/app/models/associative/
]

```

end

Rails still does not seem to be able to find the models within the  
“associative” folder.

> > pa = PersonAddress.new  
> > NameError: uninitialized constant PersonAddress  
> > from  
> > /Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active\_support/dependencies.rb:266:in  
> > `load_missing_constant' from /Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in `const\_missing’  
> > from  
> > /Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active\_support/dependencies.rb:464:in  
> > `const\_missing’  
> > from (irb):3

Here is the contents of the file models/associative/person\_address.rb:

class PersonAddress \< ActiveRecord::Base  
end

This post [Simpler irb — err.the\_blog](http://errtheblog.com/post/5) is where I saw how to tweak the  
root.rb file.

Thanks for the help
