Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails3: warning: toplevel constant ApplicationController referenced by

Everytime i get a warning:

app/controllers/agency/agencies_controller.rb:1: warning: toplevel constant ApplicationController referenced by Agency::ApplicationController

My agencies_controller.rb:

class Agency::AgenciesController < Agency::ApplicationController

  def index
    ...
  end 

  ...
end

And Agency::ApplicationController:

class Agency::ApplicationController < ApplicationController
  layout 'agency'

  helper_method :current_agency
  private

  def current_agency
    @current_agency ||= current_user.agency 
  end

end

What the rails wants from me? What is the trouble?

Same situation with another controller

class Agency::ClientsController < Agency::ApplicationController
  ...
end

And no warnings, no errors...

like image 779
petRUShka Avatar asked Jul 04 '10 17:07

petRUShka


1 Answers

In my case it was the problem with Devise. I had a devise model Admin and a namespaced routes Admin. Changing the namespaced route to Admins solved the problem.

like image 88
tundrax Avatar answered Nov 21 '22 13:11

tundrax