You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
I have a model 'site' defined in a sub-folder 'cms'
class Cms::Site < ActiveRecord::Base
.....
the model is loaded correctly , checked in console:
application.rb
config.autoload_paths += Dir["#{config.root}/app/models/**/"]
console
>Cms::Site.all => []
Now trying to access this model from a sites_controller ( in
backoffice/cms subfolder, action: index ) I get the
load_missing_constant error, aslking for the model to define Site and
not Cms::Site... where am I wrong ? or did I missed any initializing
parameter ?
backoffice/cms/sites_controller.rb
class Backoffice::Cms::SitesController < ApplicationController
def index
@sites = Cms::Site.all
end
LoadError in Backoffice::Cms::SitesController#index
Expected /Users/..../app/models/cms/site.rb to define Site
(activesupport (3.2.8) lib/active_support/dependencies.rb:503:in
`load_missing_constant')
Erwin
unread,
Oct 21, 2012, 5:55:20 AM10/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
should it not be related to the nested
namespace :backoffice :cms ? I'll try to change it
to :backoffice :cms_admin