Try this:
module Admin
class ApplicationController < ::ApplicationController
end
end
module Admin
class HomeController < ApplicationController
end
end
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?
La solution
Try this:
module Admin
class ApplicationController < ::ApplicationController
end
end
module Admin
class HomeController < ApplicationController
end
end