문제

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?

도움이 되었습니까?

해결책

Try this:

module Admin
  class ApplicationController <  ::ApplicationController
  end
end

module Admin
  class HomeController < ApplicationController
  end
end
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top