Re: uninitialized constant ApplicationController

Tom Meinlschmidt
2011-06-20T17:05:00Z

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

class Namespace::CarsController < ApplicationController
end

tom

On Jun 20, 2011, at 18:54 , amritpal pathak wrote:

>
>
> On Mon, Jun 20, 2011 at 12:48 PM, Tom Meinlschmidt
<tomas-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org> wrote:
> show us the source of one controller at least
> ya sure.
> there should be in app/controllers/admin/posts_controller.rb
>    it is as follow and it was working without using namespace i.e when it
was in /app/controller.
>     it is posts_controller.rb..:P
>
> class PostsController < ApplicationController
> #def click
> #end
> def new
> end
> def show
>   @show = Post.find(params[:id])
>   end
>   def index
>   @post = Post.new
>   end
>  def create
>   @post = Post.new(params[:post])
>   respond_to do |format|
>   if @post.save
>   format.html{ redirect_to(@post, :notice => ''Post   was
successfully created.'') }
> end
> end
>         end
>  end
>
>     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
==============================================================================