Вопрос

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