Question

route ->
 namespace :admin do
   get '' => 'home#index'
 end


 class Admin::ApplicationController < ActionController::Base
 layout 'admin'

 class Admin::HomeController < Admin::ApplicationController

When i first open just /, and then open /admin/ rails show me this:

 home_controller.rb:1: warning: toplevel constant ApplicationController referenced by     Admin::ApplicationController

But when i got to /admin/ at first time all work how expected.

Where problem is, and how to fix it?

Était-ce utile?

La solution

Try this:

module Admin
  class ApplicationController <  ::ApplicationController
  end
end

module Admin
  class HomeController < ApplicationController
  end
end
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top