I''ve looked high and low for the answer to this and can''t seem to find anything that helps. I have an admin section (much like Typo) where all controllers are based on the Admin::BaseController. My directory structure is [RAILS] -app --controllers ---admin ----base_controller.rb ----products_controller.rb Products controller is: class Admin::ProductsController < Admin::BaseController end base_controller.rb is: class Admin::BaseController end However I keep getting this error: NameError: Cannot load module Admin: Object::Admin is set to Admin Can anyone help me out with this, please? -- Posted via http://www.ruby-forum.com/.
Shouldn''t the BaseController be defined something like: class Admin::BaseController < ActionController::Base end (< ActionController::Base being the key part there) -Nick On 12/27/05, Jeff Smick <sprsquish-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve looked high and low for the answer to this and can''t seem to find > anything that helps. > > I have an admin section (much like Typo) where all controllers are based > on the Admin::BaseController. > > My directory structure is > [RAILS] > -app > --controllers > ---admin > ----base_controller.rb > ----products_controller.rb > > Products controller is: > class Admin::ProductsController < Admin::BaseController > end > > base_controller.rb is: > class Admin::BaseController > end > > However I keep getting this error: > NameError: Cannot load module Admin: Object::Admin is set to Admin > > Can anyone help me out with this, please? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
My apologies. BaseController is defined class Admin::BaseController < ApplicationController end ApplicationController is as it always is: class ApplicationController < ActionController::Base end Nick Stuart wrote:> Shouldn''t the BaseController be defined something like: > > class Admin::BaseController < ActionController::Base > end > > (< ActionController::Base being the key part there) > > -Nick-- Posted via http://www.ruby-forum.com/.
Ok just checking...been there done that one on my own :) Unfortunatly I''m not sure what the problem is then. I have an app with this same type of setup with a bunch of controllers under the admin module/directory. Guessing you generated them by: `ruby script/generate controller "admin/some_controller"`? What happens when you do the above with a default index action and you try to view it (dont change it at all)? Same error? -Nick On 12/28/05, Jeff Smick <sprsquish-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> My apologies. BaseController is defined > > class Admin::BaseController < ApplicationController > end > > ApplicationController is as it always is: > > class ApplicationController < ActionController::Base > end > > > Nick Stuart wrote: > > Shouldn''t the BaseController be defined something like: > > > > class Admin::BaseController < ActionController::Base > > end > > > > (< ActionController::Base being the key part there) > > > > -Nick > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >