Re: uninitialized constant ApplicationController

amritpal pathak
2011-06-21T02:06:30Z

On Mon, Jun 20, 2011 at 1:23 PM, Tom Meinlschmidt
<tomas-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org>wrote:

> I said...
>
> if you have posts_controller in /app/controllers/admin/posts_controller.rb
>
> then you MUST have this namespace in your class name
>
> class PostsController < ApplicationController <- WRONG
>
     ok

>
> class Admin::PostsController < ApplicationController <- RIGHT
>   done..:)
> and in your routes.rb (for rails3) have
>
> namespace :admin do
>        resources :posts
> end
>
      done.....:)
         still "localhost:3000/admin/posts" gives the error
         Routing Error
       uninitialized constant ApplicationController

amritpalpathakgne.wordpress.com