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
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.
on 2009-07-03 04:19
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.