# Modules and models

**URL:** <https://www.ruby-forum.com/t/modules-and-models/171471>\
**Category:** Rails\
**Created:** [July 3, 2009, 4:19am UTC](https://www.ruby-forum.com/t/modules-and-models/171471 "2009-07-03T04:19:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slavix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@slavix](https://www.ruby-forum.com/u/slavix)\
**Post date:** [July 3, 2009, 4:19am UTC](https://www.ruby-forum.com/t/modules-and-models/171471/1 "2009-07-03T04:19:45Z")

</div>

Hi,  
I am trying to namespace my models in a Rails app.  
I put this in routes

map.namespace(:property) do |property|  
property.root :controller =\> :venues, :active\_scaffold =\>  
true  
property.resources :location\_groups, :active\_scaffold =\>  
true  
end

and this in app/controllers/property/venues\_controller

module Property  
class VenuesController \< ApplicationController  
active\_scaffold Venue  
end  
end

this in app/modesl/property/venue

module Property  
class Venue \< ActiveRecord::Base  
has\_many :location\_groups  
end  
end

this for app/controllers/property/location\_groups\_controller

module Property  
class LocationGroupsController \< ApplicationController  
active\_scaffold LocationGroup  
end  
end

and this for app/modesl/property/location\_group

module Property  
class LocationGroup \< ActiveRecord::Base  
belongs\_to :venue  
end  
end

now if I try to load [http://localhost:3000/property/location\_groups/new](http://localhost:3000/property/location_groups/new)

I get  
ActionView::TemplateError (Could not find  
Property::Property::VenuesController or  
Property::Property::VenueController)

I am confused as to how to do this correctly… any ideas?  
Am I correct to do this? I don’t want all my models in one folder… I  
want to “package” them.
