Re: uninitialized constant ApplicationController

Tom Meinlschmidt
2011-06-20T17:23:09Z

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

class Admin::PostsController < ApplicationController <- RIGHT

and in your routes.rb (for rails3) have

namespace :admin do
	resources :posts
end

tom

On Jun 20, 2011, at 19:17 , amritpal pathak wrote:

>
>
> On Mon, Jun 20, 2011 at 1:05 PM, Tom Meinlschmidt
<tomas-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org> wrote:
> sure.. when you want to use namespace, having two options
>
> 1. "pseudo" namespace from routes
>
> in routes.rb
>
> map ''/namespace/:controller/:action/:id''
>
> and then you''ll have all the controllers in /app/controllers w/o
any namespace in class name
>
> 2. namespaced in source
>
> this one follows my previous example, eg
>
> /app/controllers/namespace/cars_controller.rb
>
> Thats what i am doing.Call you please tell me why error exists??
>
>   amritpalpathakgne.wordpress.com
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

--
==============================================================================Tomas
Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com  www.maxwellrender.cz  www.lightgems.cz
==============================================================================